Re: [racket] Continuations & side effects

2013-01-06 Thread Matthias Felleisen
Part of the problem is that you are running your program within a module. Unless a variable x is explicitly designated as assignable via (set! x ...), the execution of a module makes the variable immutable. You can see how it all gets expanded with the macro stepper (disable hiding): (module

[racket] Continuations & side effects

2013-01-06 Thread Jean-Michel HUFFLEN
Hello, Racket users! Here is an example I difficultly understand: #lang scheme (define saved '*dummy-value*) (define next-year (+ 1 (call/cc (lambda (g) (set! saved g) 1997 (saved 2012) In some other interpreters, it is OK. But Racket's answer is: define-values: cannot re-define a

Re: [racket] Randomized bisimulation tests and Metropolis-Hastings random walk

2013-01-06 Thread Matthias Felleisen
On Jan 6, 2013, at 10:38 AM, Sam Tobin-Hochstadt wrote: > Is the use of index types a fundamental refactoring, or something that > could be added to Hari's code? > > I ask because having 3+ different functional random-access data > structures seems like a loss for Racket code interoperability o

Re: [racket] Detecting application-wide keyboard presses (without open frame or dialog)

2013-01-06 Thread Erich Rast
Great! That'll do. Thank you very much! -- Erich On Sun, 6 Jan 2013 10:15:16 -0700 Matthew Flatt wrote: > For modifier keys, at least, you can use `get-current-mouse-state' > (added in 5.3.1.x). > > > Is there a cross-platform way to detect a keyboard press without > > opening any frame? ___

Re: [racket] Detecting application-wide keyboard presses (without open frame or dialog)

2013-01-06 Thread Matthew Flatt
For modifier keys, at least, you can use `get-current-mouse-state' (added in 5.3.1.x). At Sun, 6 Jan 2013 17:11:52 +, Erich Rast wrote: > Hi everybody, > > Is there a cross-platform way to detect a keyboard press, including > command keys, without opening any frame? Something like get-key-pre

[racket] Detecting application-wide keyboard presses (without open frame or dialog)

2013-01-06 Thread Erich Rast
Hi everybody, Is there a cross-platform way to detect a keyboard press, including command keys, without opening any frame? Something like get-key-press from the graphics legacy library but without viewport? I'd need this for detecting a key combination before the application's main frame opens in

Re: [racket] JSON datetime value?

2013-01-06 Thread Eli Barzilay
Yesterday, Michael Wilber wrote: > > JSON doesn't specify a way of encoding dates. See http://json.org/ > You have to convert your date to a string first, like this: IIRC, there were two common ways to encode dates -- if one of them becomes (or have become) more popular, then maybe it'll make sen

Re: [racket] Randomized bisimulation tests and Metropolis-Hastings random walk

2013-01-06 Thread Sam Tobin-Hochstadt
On Sat, Jan 5, 2013 at 7:31 PM, Neil Toronto wrote: > Thanks for the pointers! > > I can't use David Van Horn's because it's untyped, and I need to use this in > Typed Racket. Well, you might consider porting his code to Typed Racket. I hear it was designed for that. ;) > Last time I checked Ha

Re: [racket] JSON datetime value?

2013-01-06 Thread Limbo Peng
On 01/05, Michael Wilber wrote: > JSON doesn't specify a way of encoding dates. See http://json.org/ > You have to convert your date to a string first, like this: > > racket> (jsexpr->string (date->string (current-date))) > "\"Sat Jan 05 11:20:35-0700 2013\"" I'm checked both (racket/date)'s da