Re: [racket] plot-frame does not wait at end of process

2013-03-18 Thread Laurent
On Sun, Mar 17, 2013 at 10:41 PM, Eli Barzilay wrote: > Four hours ago, Laurent wrote: > > Thank you Robby, yes it helps. > > > > Based on this, I gave a try at writing a small example that > > describes some particularities of using yield or sync or creating a > > new eventspace with or without

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Eli Barzilay
Four hours ago, Laurent wrote: > Thank you Robby, yes it helps. > > Based on this, I gave a try at writing a small example that > describes some particularities of using yield or sync or creating a > new eventspace with or without a thread: [...] I think that like Robby said, `yield' should be t

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Robby Findler
For this specific program, it would behave the same way. In general what yield means is "block on this evt, but while you're blocked handle GUI events". So you call it from the eventspace handler thread of some eventspace, then that eventspace can still handle events while the evt passed to yield i

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Laurent
In his second version (see below), Matthew was basically encapsulating what you have written inside (yield ...). Would you mind to explain what differences that makes? I've read the docs but I'm still confused about `yield'. >> >> > #lang at-exp racket >> >> > (require plot >> >> >

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Robby Findler
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 GU

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Robby Findler
On Sun, Mar 17, 2013 at 1:15 AM, Eli Barzilay 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, > a

Re: [racket] plot-frame does not wait at end of process

2013-03-17 Thread Laurent
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) (begi

Re: [racket] plot-frame does not wait at end of process

2013-03-16 Thread Eli Barzilay
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 l

Re: [racket] plot-frame does not wait at end of process

2013-03-14 Thread Robby Findler
Also: I don't think that you need a parameter for this default. the current-eventspace parameter would already do this job. Robby On Thu, Mar 14, 2013 at 1:11 PM, Robby Findler wrote: > > > > On Thu, Mar 14, 2013 at 11:57 AM, Neil Toronto wrote: > >> On 03/11/2013 02:51 PM, Eli Barzilay wrote:

Re: [racket] plot-frame does not wait at end of process

2013-03-14 Thread Robby Findler
On Thu, Mar 14, 2013 at 11:57 AM, Neil Toronto wrote: > On 03/11/2013 02:51 PM, Eli Barzilay wrote: > >> A few minutes ago, Robby Findler wrote: >> >>> Michael Wilber kindly sent me the link: >>> >>> >>> http://lists.racket-lang.org/**users/archive/2012-April/**051485.html

Re: [racket] plot-frame does not wait at end of process

2013-03-14 Thread Neil Toronto
On 03/11/2013 02:51 PM, Eli Barzilay wrote: A few minutes ago, Robby Findler wrote: Michael Wilber kindly sent me the link: http://lists.racket-lang.org/users/archive/2012-April/051485.html (Ah, sorry, I thought that you knew where the discussion was...) and I think that this is not rea

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Laurent
This maybe silly, but just in case: What if Racket waits on all previously created eventspaces at the end of each program (since I guess that's what it does on the main GUI eventspace already)? Apart from backward compatibility problems, would it be a bad idea? Laurent On Mon, Mar 11, 2013 at 9:

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Robby Findler
FWIW, the OP (of the linked thread) actually wanted multi-threading so, IMO, it makes sense to make them actually explicitly ask for it in the program. Robby On Mon, Mar 11, 2013 at 3:51 PM, Eli Barzilay wrote: > A few minutes ago, Robby Findler wrote: > > Michael Wilber kindly sent me the lin

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Eli Barzilay
A few minutes ago, Robby Findler wrote: > Michael Wilber kindly sent me the link: > >   http://lists.racket-lang.org/users/archive/2012-April/051485.html (Ah, sorry, I thought that you knew where the discussion was...) > and I think that this is not really a good argument for changing the > def

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Robby Findler
Michael Wilber kindly sent me the link: http://lists.racket-lang.org/users/archive/2012-April/051485.html and I think that this is not really a good argument for changing the default behavior. A keyword argument that says "create a new eventspace" seems okay, but the docs should explain that th

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Eli Barzilay
A few minutes ago, Robby Findler wrote: > There is a tension here, but I actually think Racket's default > strategy is the best one (Matthew and I have discussed this a fair > amount way back when we were first getting GUI stuff going in > Racket; Java's strategy is different and leads to race-cond

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Robby Findler
There is a tension here, but I actually think Racket's default strategy is the best one (Matthew and I have discussed this a fair amount way back when we were first getting GUI stuff going in Racket; Java's strategy is different and leads to race-conditions easily, for example.). So if plot's func

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Jay McCarthy
I like the current behavior because I often render multiple plots and want to see them all at the same time. Jay On Mon, Mar 11, 2013 at 6:37 AM, Eli Barzilay wrote: > Just now, Robby Findler wrote: >> Neil has done this intentionally (making plot-frame create its own >> eventspace). > > Yes, I

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Eli Barzilay
Just now, Robby Findler wrote: > Neil has done this intentionally (making plot-frame create its own > eventspace). Yes, I know. And it even started from a similar use case of a quick progran that shows a plot. IMO, it is the wrong fix, because it forces the non-trivial sync line. It would be mu

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Robby Findler
Neil has done this intentionally (making plot-frame create its own eventspace). Robby On Mon, Mar 11, 2013 at 7:26 AM, Eli Barzilay wrote: > Three hours ago, Laurent wrote: > > On Mon, Mar 11, 2013 at 10:12 AM, Danny Yoo > wrote: > > > > (sync (send f get-eventspace)) > > > > Thanks Danny

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Eli Barzilay
Three hours ago, Laurent wrote: > On Mon, Mar 11, 2013 at 10:12 AM, Danny Yoo wrote: > > (sync (send f get-eventspace)) > > Thanks Danny, exactly what I need! > (I had forgotten `sync' and `get-eventspace' could be combined...) Since this is not the first time it comes up -- Neil: How about

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Laurent
On Mon, Mar 11, 2013 at 10:12 AM, Danny Yoo wrote: > (sync (send f get-eventspace)) Thanks Danny, exactly what I need! (I had forgotten `sync' and `get-eventspace' could be combined...) Laurent Racket Users list: http://lists.racket-lang.org/users

Re: [racket] plot-frame does not wait at end of process

2013-03-11 Thread Danny Yoo
On Mon, Mar 11, 2013 at 12:56 AM, Laurent wrote: > When run from the command line, the following program does not wait for the > frame to be closed, but closes it immediately and ends the program: Hi Laurent, You want to synchronize on the frame's eventspace: this will block till the windows are