1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00

julia: Pass function arguments as a mal list

This commit is contained in:
Dov Murik 2016-01-29 21:36:32 -05:00
parent cb737f83da
commit f98e3ea939
7 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,7 @@ function EVAL(ast, env)
EVAL(ast[3], env) EVAL(ast[3], env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
(args...) -> EVAL(ast[3], Env(env, ast[2], args)) (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...]))
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)
f, args = el[1], el[2:end] f, args = el[1], el[2:end]

View File

@ -61,7 +61,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)

View File

@ -61,7 +61,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)

View File

@ -82,7 +82,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)

View File

@ -107,7 +107,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)

View File

@ -125,7 +125,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)

View File

@ -125,7 +125,7 @@ function EVAL(ast, env)
end end
elseif symbol("fn*") == ast[1] elseif symbol("fn*") == ast[1]
return MalFunc( return MalFunc(
(args...) -> EVAL(ast[3], Env(env, ast[2], args)), (args...) -> EVAL(ast[3], Env(env, ast[2], Any[args...])),
ast[3], env, ast[2]) ast[3], env, ast[2])
else else
el = eval_ast(ast, env) el = eval_ast(ast, env)