mirror of
https://github.com/vonhyou/lisp-interpreter.git
synced 2025-06-08 02:02:01 +00:00
rewrite env
This commit is contained in:
parent
26072b2897
commit
55c47b641e
1 changed files with 2 additions and 1 deletions
3
prol.rb
3
prol.rb
|
@ -55,6 +55,7 @@ module Lisp
|
|||
scope.merge op => ->(*args) { args.inject(&op) }
|
||||
end
|
||||
end
|
||||
|
||||
# @global_env.merge {
|
||||
# 'min' : ->(*args) { args.min },
|
||||
# 'max' : ->(*args) { args.max },
|
||||
|
@ -91,7 +92,7 @@ module Lisp
|
|||
!lisp_eval(elem[1], env)
|
||||
else
|
||||
func, *args = elem.map { |e| lisp_eval e, env }
|
||||
func.call *args
|
||||
func.call(*args)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue