chatziko / lci

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

Scott encoding #11

Open suhr opened 2 years ago

suhr commented 2 years ago

It would be great to have a Scott encoding support for numbers and lists, as an alternative to Church encoding.

ifrh commented 2 years ago

In reply to https://github.com/chatziko/lci/issues/11#issue-1088652802

It would be great to have a Scott encoding support for numbers and lists, as an alternative to Church encoding.

From what I see, there is support for Scott numbers, or am I missing something of your point?

https://github.com/chatziko/lci/blob/2deb0d4de73d109bd1f96bbf5ea67eee627df7ef/src/.lcirc#L117-L144

suhr commented 2 years ago

Oh, cool. Are lists also Scott encoded? Also, does it works for pretty-printing too?