chatziko / lci

A lambda calculus interpeter
https://www.chatzi.org/lci/
GNU General Public License v2.0
64 stars 7 forks source link

Feature suggestion: Allow defining aliases in interactive mode #3

Closed leotaku closed 3 years ago

leotaku commented 6 years ago

Adding new aliases/identifiers in interactive mode could be a nice feature to have. Defining aliases while in a running interpreter seems to already work using the Consult 'file' command so I also don't think this should be very hard to implement. (I could of course be wrong here)

chatziko commented 6 years ago

Indeed it shouldn't be hard. PRs are welcome, of course.

chatziko commented 3 years ago

Fixed in master.

The problem was that lci was using a custom LL parser with limited capabilities (it started as a university assignment in which we had to implement our own parser :smile: ). This made it hard to combine eg alias declarations with terms.

Now I changed to dparser, so we have full GLR power.

For instance, it was pretty easy to add support for [a,b,c] list notation, as syntactic sugar for a:b:c:Nil.