uid / snapdown

Draw snapshot diagrams with plain text
MIT License
3 stars 0 forks source link

`defined` and `placed` syntax #35

Open dwhatley19 opened 3 years ago

dwhatley19 commented 3 years ago

https://web.mit.edu/dwhatley/www/snapdown/web/production.html#%231%20-%3E%201%0Aa%20-%3E%20%5B%231%2C%202%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%5D%0A---%0Ab%20-%3E%202%0A%231%20-%3E%20b

Ideally, we'd have b not be in the diagram on step 0, but also be on the left (or more generally, the user should have control over where b appears).

Proposed syntax:

b defined
#1 -> 1
a -> [#1, 2, 3, 4, 5, 6, 7, 8]
---
b -> 2
#1 -> b

Or, if we want the variable b to appear, but not point to anything yet:

b placed
#1 -> 1
a -> [#1, 2, 3, 4, 5, 6, 7, 8]
---
b -> 2
#1 -> b