home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / examples / lexyacc / cl / append.cl next >
Encoding:
Text File  |  1997-08-18  |  321 b   |  14 lines  |  [TEXT/R*ch]

  1. (* File "cl/append.cl" -- 
  2.    do indirection chains in the second argument build up? 
  3.    No. *)
  4.  
  5. letrec 
  6.   from  = \n. pack{2, n, from (n+1)};
  7.   append = \xs.\ys. case xs of
  8.                   <1>      -> ys;
  9.                       <2> x xr -> pack{2, x, append xr ys}
  10.                     end
  11.    
  12. in append (from 1) (from 1)
  13.  
  14.