monome / crow

Crow speaks and listens and remembers bits of text. A scriptable USB-CV-II machine
GNU General Public License v3.0
162 stars 34 forks source link

interpreter to allow calculator style usage (no print required) #451

Open trentgill opened 2 years ago

trentgill commented 2 years ago

currently, when you want to inspect values via the REPL (druid / norns / max etc), you currently have to wrap your element in a print() call. this gets awkward especially because you have to add characters to both start & end of the string.

instead i'd love to see an extension to the interpreter that pass statements to print under the hood. this could either by a raw call, or we could require typing = first like in many languages.

> var = 42

-- current behaviour
> var --> ERROR
> print(var) --> 42

-- 1) explicit = style
> = var --> 42

-- 2) implicit style
> var --> 42

for thoughts on implementation, take a look at the lua interpreter as it handles this. i think it previously (<5.3) required =, but now works directly (5.3+).

this will make interactive development far faster & less annoying.