1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 10:07:45 +03:00
mal/basic/variables.txt
Joel Martin c756af8196 Basic: reduce variables. Fix func printing.
- Save over 450 bytes. Bump up Z values by 128.
- Fix function printing when function is embedded in something else by
  using strings storage as a stack while printing rather than using
  RR$
- Simplify some error messages and sanity checks in RELEASE.
2016-11-04 00:07:09 -05:00

91 lines
2.2 KiB
Plaintext

Global Unique:
Z% : boxed memory values
ZI : start of unused memory (index into Z%)
ZK : start of free list (index into Z%)
ZT : top of memory after repl env allocations
S$ : string memory storage
S : next free index in S$
X% : logic/call stack (Z% indexes)
X : top element of X% stack
Y% : pending release stack [index into Z%, eval level]
Y : top element of Y% stack
D : root repl environment
ER : error type (-2: none, -1: string, >=0: object)
E$ : error string (ER=-1)
EZ : READLINE EOF
LV : EVAL stack call level/depth
RI : reader current string position
RJ : READ_TOKEN current character index
Calling arguments/temporaries:
A : common call argument (especially EVAL, EVAL_AST)
A$ : common call argument (READLINE, reader, string temp, key value)
B : common call argument
B$ : STRING arg (HASHMAP_GET temp)
C : common call argument
E : environment (EVAL, EVAL_AST)
F : function
H : hash map
K : hash map key (Z% index)
L : ALLOC* Z%(R,1) default
M : ALLOC* Z%(R+1,0) default
N : ALLOC* Z%(R+1,1) default
R : common return value
R$ : common string return value
T : type arg, common temp
AY : RELEASE/FREE arg
AZ : PR_STR arg
P1 : PR_MEMORY, CHECK_FREE_LIST start
P2 : PR_MEMORY, CHECK_FREE_LIST end
SZ : size argument to ALLOC
S1$ : REPLACE needle
S2$ : REPLACE replacement
Other temporaries:
A0 : EVAL ast elements
A1 : EVAL ast elements
A2 : EVAL ast elements
A3 : EVAL ast elements
CZ : DO_CONCAT stack position
ED : EQUAL_Q recursion depth counter
RD : PR_OBJECT recursion depth
SD : READ_STR sequence read recursion depth
C$ : READ_TOKEN, SKIP_SPACES, SKIP_TO_EOL current character
G : function value ON GOTO switch flag
I : STRING, REPLACE, SLICE, PR_MEMORY, PR_OBJECT
J : REPLACE
S1 : READ_TOKEN in a string?
S2 : READ_TOKEN escaped?
T$ : READ_* current token string
T1 : EQUAL_Q, PR_STR, and core DO_KEYS_VALS temp
T2 : EQUAL_Q, DO_KEY_VALS, HASH_MAP_GET
T3 : HASHMAP_GET temp and return value
T3$ : REPLACE temp
T4 : ENV_FIND temp and return value
T6 : LAST and QUASIQUOTE temp
T7 : READ_FORM temp
T8 : READ_FORM_DONE temp
T9 : PR_STR_SEQ temp
U3 : ALLOC
U4 : ALLOC
U6 : RELEASE
U7 : RELEASE
Unused:
O, Q, U, V, W