7

I'm using SML/NJ v110.80 and Lazy.I tried the following code in repl

Control.lazysml := true;
open Lazy;
fun f x = f x;
let val x = $(f(4)) in 15 end; 

The last expression should be 15 but it diverges. Did I make a mistake or it just works improperly? Thanks.

I find that it's my fault I should write

let val lazy x = $(f(4)) in 15 end;

I found this information here --http://www.geocities.jp/m_hiroi/func/smlnj16.html

naivehgz
  • 71
  • 3
  • Interesting question. Since this isn't standard SML, do you have any documentation that you can link to? (I suspect that the lack of documentation might be part of the problem, since this seems to be a somewhat experimental variation). – John Coleman Sep 15 '16 at 12:12
  • It turned out that it's my fault.I should write let val lazy x = $(f(4)) in 15 end; http://www.geocities.jp/m_hiroi/func/smlnj16.html – naivehgz Sep 15 '16 at 12:33

0 Answers0