[racket] plot-frame does not wait at end of process
That way has the property that each plot window has its own thread of
execution, which is probably not necessary (I don't know if plot windows
communicate or if that matters), but if it were me, I'd probably just make
one extra thread, not N, and I'd put the reading into the extra thread not
the GUI, like the below.
#lang racket/gui
(require plot)
(plot-new-window? #t)
(define (do-one)
(define dummy (read))
(cond
[(and (number? dummy) (zero? dummy))
#f]
[else
(queue-callback
(λ ()
(plot (function (λ (x) (* x x)) -2 2))))
#t]))
(when (do-one)
(void
(thread
(λ ()
(let loop ()
(when (do-one)
(loop)))))))
On Sun, Mar 17, 2013 at 4:42 AM, Laurent <laurent.orseau at gmail.com> wrote:
> So, does this means that Deren's program from
> http://lists.racket-lang.org/users/archive/2012-April/051490.html
> would then look like that:
>
> #lang racket
> (require plot)
> (plot-new-window? #t)
> (let loop ()
> (let ((dummy (read)))
> (if (and (number? dummy) (zero? dummy))
> (void)
> (begin
> (parameterize ([current-eventspace (make-eventspace)])
> (plot (function (λ(x) (* x x)) -2 2)))
> (loop)))))
>
> ?
>
> Laurent
>
>
> On Sun, Mar 17, 2013 at 7:15 AM, Eli Barzilay <eli at barzilay.org> wrote:
>
>> On Thursday, Robby Findler wrote:
>> > Also: I don't think that you need a parameter for this default. the
>> > current-eventspace parameter would already do this job.
>>
>> IOW, Robby wants no keyword or parameter, just the default behavior,
>> and if there's a problem with that then people would deal with it like
>> with any other gui code. FWIW, I'm on that side too.
>>
>> --
>> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
>> http://barzilay.org/ Maze is Life!
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130317/4fea294d/attachment.html>