mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +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:
parent
999b17ad7b
commit
402fb331d6
@ -1 +1 @@
|
|||||||
(list )
|
(def! -*ARGS*- (list ))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd $(dirname $0)
|
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
|
case ${basic_MODE:-cbm} in
|
||||||
cbm) exec cbmbasic ${STEP:-stepA_mal}.bas "${@}" ;;
|
cbm) exec cbmbasic ${STEP:-stepA_mal}.bas "${@}" ;;
|
||||||
qbasic) exec ./${STEP:-stepA_mal} "${@}" ;;
|
qbasic) exec ./${STEP:-stepA_mal} "${@}" ;;
|
||||||
|
@ -376,7 +376,7 @@ MAIN:
|
|||||||
GOSUB RE:AY=R:GOSUB RELEASE
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
REM load the args file
|
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
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
||||||
|
@ -466,7 +466,7 @@ MAIN:
|
|||||||
GOSUB RE:AY=R:GOSUB RELEASE
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
REM load the args file
|
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
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
||||||
|
@ -538,7 +538,7 @@ MAIN:
|
|||||||
GOSUB RE:AY=R:GOSUB RELEASE
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
REM load the args file
|
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
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
||||||
|
@ -571,7 +571,7 @@ MAIN:
|
|||||||
GOSUB RE:AY=R:GOSUB RELEASE
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
REM load the args file
|
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
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
||||||
|
@ -570,7 +570,7 @@ MAIN:
|
|||||||
GOSUB RE:AY=R:GOSUB RELEASE
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
REM load the args file
|
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
|
GOSUB RE:AY=R:GOSUB RELEASE
|
||||||
|
|
||||||
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
IF ER>-2 THEN GOSUB PRINT_ERROR:END
|
||||||
|
Loading…
Reference in New Issue
Block a user