mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
SML: Step 6
This commit is contained in:
parent
2f046fbefd
commit
33da2f099c
@ -70,11 +70,17 @@ val prelude = " \
|
||||
\ (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
|
||||
|
||||
fun main () = (
|
||||
bind [
|
||||
SYMBOL "eval",
|
||||
FN (fn ([x]) => eval initEnv x
|
||||
| _ => raise NotApplicable "'eval' requires one argument")
|
||||
] initEnv;
|
||||
rep initEnv prelude;
|
||||
repl initEnv
|
||||
bind [
|
||||
SYMBOL "eval",
|
||||
FN (fn ([x]) => eval initEnv x
|
||||
| _ => raise NotApplicable "'eval' requires one argument")
|
||||
] initEnv;
|
||||
rep initEnv prelude;
|
||||
case CommandLine.arguments () of
|
||||
prog::args => (
|
||||
def "*ARGV*" (LIST (map STRING args)) initEnv;
|
||||
rep initEnv ("(load-file \"" ^ prog ^ "\")");
|
||||
()
|
||||
)
|
||||
| _ => repl initEnv
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user