Scheme (programming language): Difference between revisions

Content deleted Content added
ITS
m typographical corrections for tail recursion
Line 151:
;; => (1 4 9 16)
 
We can define both of these tail-recursively as follows. The ''named'' <code>let</code> statement and the <code>do</code> statement are syntactic sugar which simpifysimplify tail-recursive definitions. To use factorial and map again to illustrate both forms:
 
(define (factorial n)
Line 171:
;; => (1 4 9 16)
 
Please note that in both cases, the tail-recursive version is preferrable due to its decreased use of space.
 
=== Input/output ===