-(types.ps) run
-(reader.ps) run
-(printer.ps) run
-(env.ps) run
-(core.ps) run
+/runlibfile where { pop }{ /runlibfile { run } def } ifelse %
+(types.ps) runlibfile
+(reader.ps) runlibfile
+(printer.ps) runlibfile
+(env.ps) runlibfile
+(core.ps) runlibfile
% read
/_readline { print flush (%stdin) (r) file 99 string readline } def
env_set
pop % discard the return value
} for
- a2 let_env EVAL
+ a2
+ let_env
+ /loop? true def % loop
}{ /do a0 eq { %if do
ast _count 2 gt { %if ast has more than 2 elements
ast 1 ast _count 2 sub _slice env eval_ast pop
/RE { READ repl_env EVAL } def
/REP { READ repl_env EVAL PRINT } def
-/_ref { _function repl_env 3 1 roll env_set pop } def
-core_ns { _ref } forall
+% core.ps: defined using postscript
+/_ref { repl_env 3 1 roll env_set pop } def
+core_ns { _function _ref } forall
+% core.mal: defined using the language itself
(\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-{ % loop
+% repl loop
+{ %loop
(user> ) _readline
not { exit } if % exit if EOF