Suggestion: add `undo`
Developers make mistakes, and a perfect language should support the developer. For example, a developer might accidentally write publishMyPrivateKeysAndPasswords()!. With undo, they can then write undo publishMyPrivateKeysAndPasswords()!, which will then generate reverse code so that the data was never published in the first place. undo undo ... undoes the undo, and vice versa. Special care must be taken when doing undo vroom (#54), because that will halt time, and undo undo vroom will create an alternative timeline. In combination with universe (#119), undo universe will create an anti-universe, and undo undo universe will create an alternative universe, etc.. undo on a variable will restore its previous value.
Update about the technical implementation:
- Every variable is implicitly treated as a stack, and the current variable's value is the stack's top.
- An
undoassigns the value right underneath the top to it. As it is an assignment, it's effectively ax.push(x[x.length-2]). - An
undo undopops off the top value. -
undo undo undothus behaves the same as a singleundo.
This makes sense since they have to be stored as a stack anyway for next and prev to work... but what if you want to undo something that happens in the future? Maybe add a don'tdo keyword (mandatory apostrophe).