tail recursion modulo cons | Contact Us
 

WK :: tail recursion modulo cons ::
[ W E B   K N O W L E D G E   O N L I N E :: tail recursion modulo cons ]
 Resources ::
WB
WBT
Addons
Baby
Cooking
Books
Runway
Legal
DVD
Electronics
Outdoor Living
Kitchen
Change
Magazines
Pop Music
PCs
Computers
Cameras
Software
Toys
Tools
Video
Computer


[W/K] :: tail recursion modulo cons


1 definition 
 for tail recursion modulo cons
From The Free On-line Dictionary of Computing (27 SEP 03) :

  tail recursion modulo cons
       
           A generalisation of tail recursion
          introduced by D.H.D. Warren.  It applies when the last thing a
          function does is to apply a constructor functions (e.g. cons)
          to an application of a non-primitive function.  This is
          transformed into a tail call to the function which is also
          passed a pointer to where its result should be written.  E.g.
       
          	f []     = []
          	f (x:xs) = 1 : f xs
       
          is transformed into (pseudo C/{Haskell):
       
          	f [] = []
          	f l  = f' l allocate_cons
       
          	f' []     p = { *p = nil;
          			return *p
          		      
          	f' (x:xs) p = { cell = allocate_cons;
          		        *p = cell;
          			cell.head = 1;
          			return f' xs &cell.tail
          		      
       
          where allocate_cons returns the address of a new cons cell, *p
          is the location pointed to by p and &c is the address of c.
       
          [D.H.D. Warren, DAI Research Report 141, University of
          Edinburgh 1980].
       
          (1995-03-06)
       
       


Request more information on tail recursion modulo cons
[W/K]
King of Torts
Perricone Prescription
Atkins
Linksys
Art
SanDisk
Cooking
Kids
Videos
Bosch
Porter
Strait-Line Laser
Legal
Black and Decker
Leatherman
Logitech Cordless
Home/Office
Religion
Windows XP
EuroPro Shark
Harrisons
Art
Management
Copyright Web Knowledge Online Inc. 1997-2003 - [privacy policy] -