antonvolkoff / slang

Experimental lisp like language
0 stars 0 forks source link

Error with function definitions #5

Open antonvolkoff opened 9 years ago

antonvolkoff commented 9 years ago

For some reason when function executes for the second time it stays with a previous values which were passed.

slang > (set sum (fn [x y] (+ x y))))
function
slang > (sum 1 1)
2
slang > (sum 2 2)
2
antonvolkoff commented 9 years ago

I have found a root of a problem.

After first execution following construction turns into:

(set sum (fn [x y] (+ 1 1))))