IF ER<>-2 THEN GOTO EVAL_RETURN
- REM AZ=A:PR=1:GOSUB PR_STR
+ REM AZ=A:B=1:GOSUB PR_STR
REM PRINT "EVAL: "+R$+" [A:"+STR$(A)+", LV:"+STR$(LV)+"]"
GOSUB DEREF_A
IF ER<>-2 THEN GOTO EVAL_RETURN
REM set a1 in env to a2
- K=A1:V=R:GOSUB ENV_SET
+ K=A1:C=R:GOSUB ENV_SET
GOTO EVAL_RETURN
EVAL_LET:
X=X+1:X%(X)=E: REM push env for for later release
REM create new environment with outer as current environment
- O=E:GOSUB ENV_NEW
+ C=E:GOSUB ENV_NEW
E=R
EVAL_LET_LOOP:
IF Z%(A1,1)=0 THEN GOTO EVAL_LET_LOOP_DONE
IF ER<>-2 THEN GOTO EVAL_LET_LOOP_DONE
REM set environment: even A1 key to odd A1 eval'd above
- K=A1+1:V=R:GOSUB ENV_SET
+ K=A1+1:C=R:GOSUB ENV_SET
AY=R:GOSUB RELEASE: REM release our use, ENV_SET took ownership
REM skip to the next pair of A1 elements
EVAL_FN:
GOSUB EVAL_GET_A2: REM set A1 and A2
- A=A2:P=A1:GOSUB MAL_FUNCTION
+ A=A2:B=A1:GOSUB MAL_FUNCTION
GOTO EVAL_RETURN
EVAL_INVOKE:
REM if error, pop and return f/args for release by caller
R=X%(X):X=X-1
- ER=-1:ER$="apply of non-function":GOTO EVAL_RETURN
+ ER=-1:E$="apply of non-function":GOTO EVAL_RETURN
EVAL_DO_FUNCTION:
REM regular function
E4=E: REM save the current environment for release
REM create new environ using env stored with function
- O=Z%(F+1,1):BI=Z%(F+1,0):EX=AR:GOSUB ENV_NEW_BINDS
+ C=Z%(F+1,1):A=Z%(F+1,0):B=AR:GOSUB ENV_NEW_BINDS
REM release previous env if it is not the top one on the
REM stack (X%(X-2)) because our new env refers to it and
E=R:GOTO EVAL_TCO_RECUR: REM TCO loop
EVAL_RETURN:
- REM AZ=R: PR=1: GOSUB PR_STR
+ REM AZ=R: B=1: GOSUB PR_STR
REM PRINT "EVAL_RETURN R: ["+R$+"] ("+STR$(R)+"), LV:"+STR$(LV)+",ER:"+STR$(ER)
REM release environment if not the top one on the stack
GOSUB RELEASE_PEND
REM trigger GC
- #cbm TA=FRE(0)
- #qbasic TA=0
+ #cbm T=FRE(0)
+ #qbasic T=0
REM pop A and E off the stack
E=X%(X-1):A=X%(X):X=X-2
REM PRINT(A) -> R$
MAL_PRINT:
- AZ=A:PR=1:GOSUB PR_STR
+ AZ=A:B=1:GOSUB PR_STR
RETURN
REM RE(A$) -> R
LV=0
REM create repl_env
- O=-1:GOSUB ENV_NEW:D=R
+ C=-1:GOSUB ENV_NEW:D=R
REM core.EXT: defined in Basic
E=D:GOSUB INIT_CORE_NS: REM set core functions in repl_env
END
PRINT_ERROR:
- PRINT "Error: "+ER$
- ER=-2:ER$=""
+ PRINT "Error: "+E$
+ ER=-2:E$=""
RETURN