mirror of
https://github.com/kanaka/mal.git
synced 2024-09-20 10:07:45 +03:00
a742287e0e
- Modify ALLOC to take a type (rather than size) and take default values to set for the 1-3 values/pointers. Let alloc do the ownership taking of the referred values when appropriate. - Add FORCE_SEQ_TYPE function to coerce sequence to given type. Fixes apply and rest on vector. Simplifies concat. - Use a double ON GOTO structure for calling the native functions in DO_FUNCTION. - Add some stub core functions. - Move CHECK_FREE_LIST to debug.in.bas - All changes together save over 1K
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
Global Unique:
|
|
|
|
Z% : boxed memory values
|
|
ZI : start of unused memory (index into Z%)
|
|
ZK : start of free list (index into Z%)
|
|
|
|
S$ : string memory storage
|
|
ZJ : next free index in S$
|
|
|
|
S% : logic/call stack (Z% indexes)
|
|
X : top element of S% stack
|
|
|
|
ZR% : pending release stack (index into Z%, eval level)
|
|
ZM% : top element of ZR% stack
|
|
|
|
RE% : root repl environment
|
|
|
|
ER : error type (-2: none, -1: string, >=0: object)
|
|
ER$ : error string (ER=-1)
|
|
|
|
LV : EVAL stack call level/depth
|
|
|
|
Calling arguments/temporaries:
|
|
|
|
A : common call arguments (especially EVAL, EVAL_AST)
|
|
B : common call arguments
|
|
C : common call arguments
|
|
E : environment (EVAL, EVAL_AST)
|
|
F : function
|
|
H : hash map
|
|
K : hash map key (Z% index)
|
|
K$ : hash map key string
|
|
L : ALLOC* Z%(R,1) default
|
|
M : ALLOC* Z%(R+1,0) default
|
|
N : ALLOC* Z%(R+1,1) default
|
|
O : outer environment
|
|
P : MAL_FUNCTION
|
|
R : common return value
|
|
T : common temp, type
|
|
V : hash map value
|
|
|
|
SZ : size argument to ALLOC
|
|
|
|
Reused/temporaries:
|
|
|
|
I : STRING, REPLACE, SLICE, PR_MEMORY, PR_OBJECT
|
|
J : REPLACE
|
|
|
|
Unused:
|
|
|
|
D, G, L, M, N, Q, U, W, Y
|