12 lines
496 B
Plaintext
12 lines
496 B
Plaintext
{ {extern "manool.org.18/std/0.3/all"} in
|
|
: let { Y = {proc {F} as {proc {X} as X[X]}[{proc {X} with {F} as F[{proc {Y} with {X} as X[X][Y]}]}]} } in
|
|
{ for { N = Range[10] } do
|
|
: (WriteLine) Out; N "! = "
|
|
{Y: proc {Rec} as {proc {N} with {Rec} as: if N == 0 then 1 else N * Rec[N - 1]}}$[N]
|
|
}
|
|
{ for { N = Range[10] } do
|
|
: (WriteLine) Out; "Fib " N " = "
|
|
{Y: proc {Rec} as {proc {N} with {Rec} as: if N == 0 then 0 else: if N == 1 then 1 else Rec[N - 2] + Rec[N - 1]}}$[N]
|
|
}
|
|
}
|