Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty (?) reference to a function definition in a list of expressions. #1372

Closed
ghost opened this issue Aug 7, 2017 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Aug 7, 2017

I am trying to learn Hy by using Calysto Hy ipython kernel.

The problem is, however, that there seems to be a problem with return values of function definitions.

Specifically:

If I run the following code in a separate cell:

(def a '(+ (+ 2 3) (* 3 4)))
(def b "bbb")
a

Out[]: displays nothing.

Then I run it like this:

(def a '(+ (+ 2 3) (* 3 4)))
(def b "bbb")
a
b

Out[]: displays ('+' ('+' 2 3) ('*' 3 4))

And the following code:

(def a '(+ (+ 2 3) (* 3 4)))
(def b "bbb")
a
b
a

Evaluates to:
'bbb'

This behaviour is not present in a raw Hy interpreter opened in console.

The version of Calysto Hy is from GIT.
Python version is 3.5.2.
Hy version is 0.13.0

I filed a bug in the Calysto Hy issue tracker:
Calysto/calysto_hy#4
@Calysto_hy

But Calysto Hy developers suspect it might be an issue with Hy itself.

@Kodiologist
Copy link
Member

To be clear, none of the Hy code you've quoted here includes a function definition. In Hy, def is just a synonym for setv, or in Python terms, =. Functions are defined with defn or fn.

The behavior of your code does seem weird, but I wouldn't know where to look in Hy without a way to replicate this bug that uses only Hy itself.

If Calysto Hy didn't have this issue with previous versions of Hy, the changes to the REPL that occurred in #1246 are probably the culprit.

@Kodiologist
Copy link
Member

I'm going to close this, but let's reopen it if a way is found to replicate the bug with Hy alone, or if it's otherwise verified that the problem is with Hy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant