Online Computer Dictionary
Browse words
|
Based on
FOLDOC
Queried for: tail recursion modulo cons
Definition:
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].
Browse through top 20 categories or see more ...
- programming (659)
- application (76)
- networking (823)
- language (1034)
- operating_system (420)
- mathematics (228)
- graphics (155)
- compiler (21)
- library (41)
- World-Wide_Web (133)
- cryptography (36)
- database (166)
- algorithm (132)
- logic (61)
- software (72)
- audio (27)
- virtual_reality (10)
- communications (329)
- file system (28)
- filename_extension (25)


