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

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Jul 19 08:57:45 EDT 2014

Ouch, This is precisely the kind of (imperative) change I didn't hope to see. I will look at the file in a moment but I'd hope you can do this with a lambda wrapper instead of a set!. -- Matthias



On Jul 19, 2014, at 1:27 AM, gcooper at racket-lang.org wrote:

> pkgs/frtime/lang-ext.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~
> --- OLD/pkgs/frtime/lang-ext.rkt
> +++ NEW/pkgs/frtime/lang-ext.rkt
> @@ -412,17 +412,7 @@
>                               (current-inexact-milliseconds))
>                         empty)]
>            [head last]          
> -           [consumer (proc->signal
> -                      (lambda ()
> -                        (let* ([now (current-inexact-milliseconds)]
> -                               [new (deep-value-now beh empty)]
> -                               [ms (value-now ms-b)])
> -                          (when (not (equal? new (car (mcar last))))
> -                            (set-mcdr! last (mcons (cons new now)
> -                                                   empty))
> -                            (set! last (mcdr last))
> -                            (schedule-alarm (+ now ms) producer))))
> -                      beh ms-b)]
> +           [consumer #f]
>            [producer (proc->signal
>                       (lambda ()
>                         (let* ([now (and (signal? consumer) (current-inexact-milliseconds))]
> @@ -437,7 +427,19 @@
>                               (begin
>                                 (set! head (mcdr head))
>                                 (loop)))))))])
> -    producer))
> +    (begin
> +      (set! consumer (proc->signal
> +                      (lambda ()
> +                        (let* ([now (current-inexact-milliseconds)]
> +                               [new (deep-value-now beh empty)]
> +                               [ms (value-now ms-b)])
> +                          (when (not (equal? new (car (mcar last))))
> +                            (set-mcdr! last (mcons (cons new now)
> +                                                   empty))
> +                            (set! last (mcdr last))
> +                            (schedule-alarm (+ now ms) producer))))
> +                      beh ms-b))
> +      producer)))
> 
> (define (inf-delay beh)
>   (delay-by beh 0))
> @@ -451,8 +453,8 @@
>              [last-time (current-inexact-milliseconds)]
>              [last-val (value-now b)]
>              [last-alarm 0]
> -             [producer (proc->signal (lambda () (and (signal? consumer) accum)))]
> -             [consumer (proc->signal void b ms-b)])
> +             [consumer (proc->signal void b ms-b)]
> +             [producer (proc->signal (lambda () (and (signal? consumer) accum)))])
>       (set-signal-thunk!
>        consumer
>        (lambda ()



Posted on the dev mailing list.