antonvolkoff / slang

Experimental lisp like language
0 stars 0 forks source link

If statement #1

Closed antonvolkoff closed 9 years ago

antonvolkoff commented 9 years ago

When if is executed it evaluates both cases (true and false). Which could cause problems in a future. It should be moved out of Env to eval

antonvolkoff commented 9 years ago

Here is an example of broken code:

slang > (if true (def x 1) (def x 2))
1
slang > x
2
antonvolkoff commented 9 years ago

it was fixed with PR #2

slang > (if true (set x 1) (set x 2))
1
slang > x
1