November 2016

S M T W T F S
  1 2345
6789101112
13141516171819
20212223 242526
27282930   

Style Credit

Expand Cut Tags

No cut tags

May 1st, 2010

avysk: (dwarf)
Saturday, May 1st, 2010 05:10 pm
Запуск интерпретатора: 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
-