Please add a test case. Robby
On Wed, Jan 26, 2011 at 2:27 PM, <stch...@racket-lang.org> wrote: > stchang has updated `master' from 8cbc701671 to 39194ba5da. > http://git.racket-lang.org/plt/8cbc701671..39194ba5da > > =====[ 1 Commits ]====================================================== > > Directory summary: > 100.0% collects/lazy/ > > ~~~~~~~~~~ > > 39194ba Stephen Chang <stchang...@gmail.com> 2011-01-26 15:27 > : > | in lazy.rkt, fix bug in take, where (take 0 non-null-list) was not > evaluating to null > : > M collects/lazy/lazy.rkt | 5 ++++- > > =====[ Overall Diff ]=================================================== > > collects/lazy/lazy.rkt > ~~~~~~~~~~~~~~~~~~~~~~ > --- OLD/collects/lazy/lazy.rkt > +++ NEW/collects/lazy/lazy.rkt > @@ -585,7 +585,10 @@ > ;; to its head, which can lead to memory leaks. > (error 'take "index ~e too large for input list" n0) > '())] > - [(pair? l) (cons (car l) (~ (loop (sub1 n) (! (cdr l)))))] > + [(pair? l) > + (if (zero? n) > + '() > + (cons (car l) (~ (loop (sub1 n) (! (cdr l))))))] > [else (error 'take "not a proper list: ~e" l)])) > (raise-type-error 'take "non-negative exact integer" 0 n l)))) > > _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev