[Feature request] FMC Insertions in Twizzle Editor
Goal
I'd like for there to be a way to add insertions (for showing FMC solutions).
Possible solution
Have some special marker or reserved character to indicate insertion point, then later there is a line that gives the insertion. But there would have to be multiple such markers to handle multiple insertions, as well as the nested cases where there is an insertion inside an insertion.
Alternatives
No response
My current thinking for insertions is to implement them based on Markdown, similar to caret NISS:
R' U [^1] R'
[^1]: [U', R' D' R]
The annotation could also optionally be placed onto a grouping, indicating a replacement insertion:
R' U (F L B)[^1] R'
[^1]: [U', R' D' R]
This can't quite cover every use case, but I think covering every use case is impossible. So I think this is the most intuitive and flexible option.
My main concern, however, is that the syntax doesn't prevent people from defining algs as macros and building very complex dependencies that are:
- Tricky for programs to implement correctly, efficiently, and safety.
- Tricky for humans to understand and debug.
We could try to restrict this by specifying that each annotation can only be referenced once in the rest of the alg and/or restricting nesting. But I suspect that these will be annoying limitations that people will ask to remove. (For example, it will be annoying if copying and pasting parts of your solution just sometimes gets rejected by the parser. Copying and pasting parts of solutions is a normal part of drafting.)
In other words, FMC insertions essentially turn into macro processing and we need to be ready to accept that when we implement it.