Add proper support for escape manipulation by Actions#1047
Add proper support for escape manipulation by Actions#1047Robotgiggle wants to merge 13 commits into
Conversation
object-Object
left a comment
There was a problem hiding this comment.
Didn't fully review (am on a phone), but skimmed and noticed some problematic breaking changes.
fb56cc9 to
6b605c9
Compare
object-Object
left a comment
There was a problem hiding this comment.
This is coming along! Overall this change looks pretty good, and it's nice to make the VM less hardcoded; however, there are some things in the API that could be cleaned up, as well as some potential refactors and documentation improvements.
There was a problem hiding this comment.
Should we also document that Hasty Retrospection was renamed to Absent Introspection?
| * The behavior of this action when inside parentheses. By default, this is just to add the pattern | ||
| * to the parenthesized list without updating the op count or performing any of its usual effects. | ||
| */ | ||
| @Throws(Mishap::class) |
There was a problem hiding this comment.
Hmm, is it really a good idea to allow addons to throw mishaps while parenthesized? Do we handle this correctly? I don't think any base hex pattern currently does this.
There was a problem hiding this comment.
Throwing mishaps while parenthesized will be necessary to address the Evanition issue you mentioned above, along with a plan I have for a read-from-offhand-into-parens pattern. Also, I see no reason why allowing addons to do that would be problematic - imo it's better to natively allow interesting functionality like that rather than forcing people to make their own workarounds.
As for handling, any thrown mishap will be caught and handled by the try/catch in Iota.lookupAndOperate, exactly like a mishap thrown from the normal Action.operate method.
f0a0e0b to
76b3118
Compare
Adds the
operateInParensmethod to allowActions to define custom behavior when executed inside parentheses, and removes all the hardcoded jank that was used to do this before.This enables the previously hardcoded patterns for escape manipulation (Consideration, Introspection, Retrospection, and Evanition) to be turned into normal
Actions, and also makes it possible to add new escape manipulators in addons or future updates.Also fixes #1077 by adding a new mishap for when Evanition has nothing to remove.