robpike / ivy

ivy, an APL-like calculator
Other
1.32k stars 103 forks source link

ivy: fix )save of new index expression, multiline functions #94

Closed rsc closed 2 years ago

rsc commented 2 years ago

The new index expression was not accounted for in the reference walk. This commit adds that.

Also, multiline functions were not followed by a blank line in the save output, meaning that the output of )save could not be parsed back with )get. This commit adds a blank line in )save.

I considered adding a blank line to Function.String, but that changed the output of )op f to end in two blank lines, one provided by Function.String and one provided by the interpreter loop. That seemed like too much, so I put the special case into )save itself.