rkoeninger / ShenSharp

Shen for the Common Language Runtime
BSD 3-Clause "New" or "Revised" License
33 stars 2 forks source link

Corrections to conditionals #2

Closed rkoeninger closed 7 years ago

rkoeninger commented 7 years ago

In the CLisp and Ruby (according to unit tests) implementations, the or and and forms can be applied to one argument that is eagerly evaluated and return a lambda that evals the another conditional. The if form can also be applied to less than 3 args, which get eagerly evaluated and return a lambda. This does not appear to work in the Haskell implementation.

The CLisp and Haskell implementations have a cond form that returns () when no conditions eval to true.

rkoeninger commented 7 years ago

cond expression fixed in 14663bf26ace8702981138d77b147282c245c56c

rkoeninger commented 7 years ago

if, and, or can now be partially applied, but do not do short-circuit evaluation unless applied in full.

Demonstration can be seen here.

Fixed in c1529a23d3ed88b13fe6753110c65007812a6c3f