stedolan / malfunction

Malfunctional Programming
Other
338 stars 19 forks source link

zero argument functions - Difference between Interpreted and Compiled Code. #17

Closed xekoukou closed 5 years ago

xekoukou commented 6 years ago

There is a difference between the interpreter(1) and the Compiler in handling zero argument functions.

1.

Updated the comment to only report the inconsistency.

stedolan commented 5 years ago

Zero argument functions aren't supported. Functions are curried, so a two-argument function is actually a curried function 'a -> 'b -> 'c. A zero-argument function would just be a value.

b2802dbd88210f76f994d8ee11662501a21a81a0 removes some confusion by making zero-argument lambdas and applications a syntax error.

As of very recently, Malfunction supports (lazy ...) and (force ...), which are a better way of representing thunks.