Proposal - a "CELL" iota for one-shot mutability
Posted: Mon Jul 24, 2023 4:38 pm
Floated this on Discord, but I figured I'd better archive it for posterity.
A fun notion I've been tossing around is the idea of a 'CELL' Iota, which is either empty (holds NULL) or contains a value. CELLs start out empty.
You'd interact with them in three ways:
Monk's Reflection - Pushes a new empty CELL to the stack. Costs a negligible amount.
Monk's Purification - Turns a CELL into its value, or NULL if the CELL is empty. Free (or costs very little).
Monk's Distillation - Pops a value, then puts it into the (empty) CELL at the top of the stack; all copies of the same CELL receive this value. Costs a few dust, tops. (Mishaps if the CELL is not empty.)
You could of duplicate CELLs, save copies in foci, etc. and they'd get updated to Purify to the same value after the Distillation. Notably, though, a CELL could only be set once. (If you want mutability, set the CELL to a list of {new value, <a fresh CELL>}, then write a Hex to walk through the chain of lists )
Seems they'd open up some interesting possibilities… might be fun to play with
A fun notion I've been tossing around is the idea of a 'CELL' Iota, which is either empty (holds NULL) or contains a value. CELLs start out empty.
You'd interact with them in three ways:
Monk's Reflection - Pushes a new empty CELL to the stack. Costs a negligible amount.
Monk's Purification - Turns a CELL into its value, or NULL if the CELL is empty. Free (or costs very little).
Monk's Distillation - Pops a value, then puts it into the (empty) CELL at the top of the stack; all copies of the same CELL receive this value. Costs a few dust, tops. (Mishaps if the CELL is not empty.)
You could of duplicate CELLs, save copies in foci, etc. and they'd get updated to Purify to the same value after the Distillation. Notably, though, a CELL could only be set once. (If you want mutability, set the CELL to a list of {new value, <a fresh CELL>}, then write a Hex to walk through the chain of lists )
Seems they'd open up some interesting possibilities… might be fun to play with