It took a couple of days but I've now completely rewritten my parser so it can serve both for display and computation duties. Displaying requires keeping track of spaces. Computation requires detecting invalid statements.
Now 💬 #devlog-together@2024-09-18 can perform computations in (indented) code lines.
Still missing: synchronization between code lines and prose lines. The screenshot for example shows me redundantly defining ice_kg = 2
to provide it to code lines. Also, heat_flux
is computed in code, but not yet filled in the blank space in prose.
I'm continuing to accumulate design principles:
- (generalizing from before) Everything is visible and easy to discover, whether it's the formula for a blank or the syntax to define a new blank or how to change colors. Any pattern you see on screen is easy to copy with the keyboard. (The one exception right now is the use of
|
characters in blanks and/
in code. Both turn into horizontal lines.) - What you typed in is saved in the document -- except what you put into blanks in prose. Blanks are not saved, but can override default values defined in code.