nat-to-str(n) ==
  Y 
  (
nat-to-str,n.
    if (n =
 0) then [0]
    if (n =
 1) then [1]
    if (n =
 2) then [2]
    if (n =
 3) then [3]
    if (n =
 4) then [4]
    if (n =
 5) then [5]
    if (n =
 6) then [6]
    if (n =
 7) then [7]
    if (n =
 8) then [8]
    if (n =
 9) then [9]
    else (nat-to-str (n 
 10)) @ (nat-to-str (n rem 10))
    fi ) 
  n
Definitions : 
ycomb: Y, 
lambda:
x.A[x], 
ifthenelse: if b then t else f fi , 
eq_int: (i =
 j), 
cons: [car / cdr], 
token: "$token", 
nil: [], 
append: as @ bs, 
divide: n 
 m, 
apply: f a, 
remainder: n rem m, 
natural_number: $n
FDL editor aliases : 
nat-to-str
nat-to-str(n)  ==
    Y 
    (\mlambda{}nat-to-str,n.
        if  (n  =\msubz{}  0)  then  [0]
        if  (n  =\msubz{}  1)  then  [1]
        if  (n  =\msubz{}  2)  then  [2]
        if  (n  =\msubz{}  3)  then  [3]
        if  (n  =\msubz{}  4)  then  [4]
        if  (n  =\msubz{}  5)  then  [5]
        if  (n  =\msubz{}  6)  then  [6]
        if  (n  =\msubz{}  7)  then  [7]
        if  (n  =\msubz{}  8)  then  [8]
        if  (n  =\msubz{}  9)  then  [9]
        else  (nat-to-str  (n  \mdiv{}  10))  @  (nat-to-str  (n  rem  10))
        fi  ) 
    n
Date html generated:
2010_08_26-PM-11_30_07
Last ObjectModification:
2010_02_10-PM-02_08_33
Home
Index