jstolarek / slicer

Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
http://dl.acm.org/citation.cfm?id=3110258
GNU General Public License v3.0
6 stars 0 forks source link

Program-style let bindings parse in REPL although they shouldn't #33

Open jstolarek opened 7 years ago

jstolarek commented 7 years ago

Loading this single-line file into REPL works:

let abs = fun abs (x : int) : int => if x > 0 then x else (0 - x) in

The problem is that it shouldn't. Notice the in at the end of line - these kind of let bindings are not allowed in REPL and should be a parse error. Even more strangely deleting the in also works, which means both forms of let-bindings are accepted. This is a nice feature, but according to my understanding of the source code this should not work this way. I want to understand why it does work.