[racket-dev] [plt] Push #22080: master branch updated

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Jan 26 15:28:48 EST 2011

Please add a test case.

Robby

On Wed, Jan 26, 2011 at 2:27 PM,  <stchang at 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 <stchang216 at 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))))
>
>

Posted on the dev mailing list.