lib/vm/environment.rb in p-lang-0.3.0 vs lib/vm/environment.rb in p-lang-0.3.1
- old
+ new
@@ -30,10 +30,13 @@
#TODO: new operator to add lambdas
def add_lambda(id, lamb)
v = get_var(id)
if v
if v.id == :lambda and lamb.id == :lambda
- v.params |= lamb.params
+ while v.params[1].id == :lambda
+ v = v.params[1]
+ end
+ v.params[1] = lamb
else
raise "TODO: Environment#add_lambda#2"
end
else
raise "TODO: Environment#add_lambda#1"