10 lines
505 B
Plaintext
10 lines
505 B
Plaintext
parameter (or string (pair string (lambda unit string)));
|
|
return string;
|
|
storage (map string (lambda unit string));
|
|
code { DUP; DIP{CDR}; CAR; # Unpack stack
|
|
IF_LEFT { DIP{DUP}; GET; # Get lambda if it exists
|
|
IF_NONE {FAIL} {}; # Fail if it doesn't
|
|
UNIT; EXEC } # Execute the lambda
|
|
{ DUP; CAR; DIP {CDR; SOME}; UPDATE; PUSH string ""}; # Update the storage
|
|
PAIR} # Calling convention
|