1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-17 09:40:21 +03:00

basic: args file that doesn't rely on return value.

Instead, the file itself does the def of -*ARGS*-. The behavior that
the final value of a loaded file is returned is not necessarily
something we want to assume.
This commit is contained in:
Joel Martin 2019-07-26 00:15:39 -05:00
parent 999b17ad7b
commit 402fb331d6
7 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
(list )
(def! -*ARGS*- (list ))

View File

@ -1,6 +1,6 @@
#!/bin/bash
cd $(dirname $0)
(echo "(list $(for a in "${@}"; do echo -n "\"${a}\""; done))") > .args.mal
(echo "(def! -*ARGS*- (list $(for a in "${@}"; do echo -n " \"${a}\""; done)))") > .args.mal
case ${basic_MODE:-cbm} in
cbm) exec cbmbasic ${STEP:-stepA_mal}.bas "${@}" ;;
qbasic) exec ./${STEP:-stepA_mal} "${@}" ;;

View File

@ -376,7 +376,7 @@ MAIN:
GOSUB RE:AY=R:GOSUB RELEASE
REM load the args file
A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
A$="(load-file "+CHR$(34)+".args.mal"+CHR$(34)+")"
GOSUB RE:AY=R:GOSUB RELEASE
IF ER>-2 THEN GOSUB PRINT_ERROR:END

View File

@ -466,7 +466,7 @@ MAIN:
GOSUB RE:AY=R:GOSUB RELEASE
REM load the args file
A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
A$="(load-file "+CHR$(34)+".args.mal"+CHR$(34)+")"
GOSUB RE:AY=R:GOSUB RELEASE
IF ER>-2 THEN GOSUB PRINT_ERROR:END

View File

@ -538,7 +538,7 @@ MAIN:
GOSUB RE:AY=R:GOSUB RELEASE
REM load the args file
A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
A$="(load-file "+CHR$(34)+".args.mal"+CHR$(34)+")"
GOSUB RE:AY=R:GOSUB RELEASE
IF ER>-2 THEN GOSUB PRINT_ERROR:END

View File

@ -571,7 +571,7 @@ MAIN:
GOSUB RE:AY=R:GOSUB RELEASE
REM load the args file
A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
A$="(load-file "+CHR$(34)+".args.mal"+CHR$(34)+")"
GOSUB RE:AY=R:GOSUB RELEASE
IF ER>-2 THEN GOSUB PRINT_ERROR:END

View File

@ -570,7 +570,7 @@ MAIN:
GOSUB RE:AY=R:GOSUB RELEASE
REM load the args file
A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
A$="(load-file "+CHR$(34)+".args.mal"+CHR$(34)+")"
GOSUB RE:AY=R:GOSUB RELEASE
IF ER>-2 THEN GOSUB PRINT_ERROR:END