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

if statements in arg lists get evaluated out of order #205

Open
dunhamsteve opened this issue Sep 18, 2018 · 3 comments
Open

if statements in arg lists get evaluated out of order #205

dunhamsteve opened this issue Sep 18, 2018 · 3 comments

Comments

@dunhamsteve
Copy link

When an if occurs in an argument list, it is evaluated before any proceeding arguments. I was expecting the arguments to be evaluated in order.

E.g. I expect the following to evaluate to (1 2), but it evaluates to (2 1) (here str is a placeholder for a function of two arguments and add represents something with side-effects).

(with r () (str (add r 1) (if true (add r 2))))
@sctb
Copy link
Owner

sctb commented Sep 18, 2018

Yes, you're absolutely right. I've dealt with this behavior in other projects but haven't updated Lumen. Perhaps @shawwn has (or has had) a patch for this?

@dunhamsteve
Copy link
Author

Note that this isn't affecting me at the moment (that I know of), it's just an edge case that came to mind while thinking about implementing my own lisp on top of javascript. (I've managed to tweak lumen to my liking, just thought it'd be fun to write my own.)

@shawwn
Copy link
Contributor

shawwn commented Sep 20, 2018

It's worth fixing. I've run into this too.

Patch soon.

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

3 participants