Changeset 39752 in project


Ignore:
Timestamp:
03/23/21 12:49:38 (4 weeks ago)
Author:
Idiomdrottning
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/lazy-seq

    r36879 r39752  
    211211<enscript language="scheme">
    212212(define odd-numbers
    213   (let next ((n 0))
     213  (let next ((n 1))
    214214    (lazy-seq
    215       (if (odd? n)
    216         (cons n (next (+ n 1)))
    217         (next (+ n 1))))))
     215     (cons n (next (+ n 2))))))
    218216
    219217(lazy-ref 5 odd-numbers) ; => 11
Note: See TracChangeset for help on using the changeset viewer.