diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-19 13:04:09 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-19 13:04:09 -0500 |
| commit | 86b689f3d7111a9fa13da389a30f3dfdf877d1a4 (patch) | |
| tree | d72b065f9f987e291f892ceee5a8640363bfd9df /ps/stepA_more.ps | |
| parent | 718887c3019c49fc807bc18fbd5feb975ec03c85 (diff) | |
| download | mal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.tar.gz mal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.zip | |
All: *ARGV* and *host-language*. Misc syncing/fixes.
Diffstat (limited to 'ps/stepA_more.ps')
| -rw-r--r-- | ps/stepA_more.ps | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ps/stepA_more.ps b/ps/stepA_more.ps index 73403b0..744a092 100644 --- a/ps/stepA_more.ps +++ b/ps/stepA_more.ps @@ -247,9 +247,10 @@ end } def /REP { READ repl_env EVAL PRINT } def % core.ps: defined using postscript -/_ref { _function repl_env 3 1 roll env_set pop } def -core_ns { _ref } forall -(eval) { 0 _nth repl_env EVAL } _ref +/_ref { repl_env 3 1 roll env_set pop } def +core_ns { _function _ref } forall +(eval) { 0 _nth repl_env EVAL } _function _ref +(*ARGV*) [ ] _list_from_array _ref % core.mal: defined using the language itself (\(def! *host-language* "postscript"\)) RE pop @@ -260,13 +261,17 @@ core_ns { _ref } forall userdict /ARGUMENTS known { %if command line arguments ARGUMENTS length 0 gt { %if more than 0 arguments - ARGUMENTS { - (\(load-file ") exch ("\)) concatenate concatenate RE pop - } forall + (*ARGV*) ARGUMENTS 1 ARGUMENTS length 1 sub getinterval + _list_from_array _ref + ARGUMENTS 0 get + (\(load-file ") exch ("\)) concatenate concatenate RE pop quit } if } if -{ % loop + +% repl loop +(\(println \(str "Mal [" *host-language* "]"\)\)) RE pop +{ %loop (user> ) _readline not { exit } if % exit if EOF |
