10 lines
523 B
Plaintext
10 lines
523 B
Plaintext
parameter (or string (option int));
|
|
storage string;
|
|
code { CAR; # Access the storage
|
|
IF_LEFT {} # The string is on top of the stack, nothing to do
|
|
{ IF_NONE { FAIL} # Fail if None
|
|
{ PUSH int 0; CMPGT; # Check for negative number
|
|
IF {FAIL} # Fail if negative
|
|
{PUSH string ""}}}; # Push the empty string
|
|
NIL operation; PAIR} # Calling convention
|