1
1
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:
Fabian 2021-04-01 19:31:26 +02:00 committed by Joel Martin
parent 2f046fbefd
commit 33da2f099c

View File

@ -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
)