Запуск интерпретатора: sml -Cparser.lazy-keyword=true.
Затем
Standard ML of New Jersey v110.71 [built: Tue Jan 5 15:50:24 2010]
- open Lazy;
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[autoloading done]
opening Lazy
datatype 'a susp = $ of 'a
- val a = $1;
val a = $$ : int susp
- val b = $2;
val b = $$ : int susp
- fun lazy plus ($x, $y) = $(x+y);
val plus = fn : int susp * int susp -> int susp
val plus_ = fn : int susp * int susp -> int
- val c = plus(a, b);
val c = $$ : int susp
- fun force ($x) = x;
val force = fn : 'a susp -> 'a
- force c;
val it = 3 : int
- plus_ (a, b);
val it = 3 : int
-
Затем
- open Lazy;
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[autoloading done]
opening Lazy
datatype 'a susp = $ of 'a
- val a = $1;
val a = $$ : int susp
- val b = $2;
val b = $$ : int susp
- fun lazy plus ($x, $y) = $(x+y);
val plus = fn : int susp * int susp -> int susp
val plus_ = fn : int susp * int susp -> int
- val c = plus(a, b);
val c = $$ : int susp
- fun force ($x) = x;
val force = fn : 'a susp -> 'a
- force c;
val it = 3 : int
- plus_ (a, b);
val it = 3 : int
-