Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Nadeem Abdul Hamid
On Sat, Jul 16, 2011 at 12:34 AM, Mark Engelberg wrote: > > Because the image is not only dependent upon the current location of > the sprite, but also the entire history of the sprite's movements when > its pen was down. So you either have to store a very long list of > line segments in the worl

Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Mark Engelberg
On Fri, Jul 15, 2011 at 11:56 AM, Stephen Bloch wrote: > Last Monday I attended Dan Garcia's workshop on BYOB.  He kept pointing out > (presumably for the benefit of Emmanuel and me) that it really is a > functional language.  And yes, it has "map", "filter", "foldl", and > "lambda"... but most

Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Mark Engelberg
On Fri, Jul 15, 2011 at 12:24 PM, Nadeem Abdul Hamid wrote: >  Why don't you just have the picture generated based on the state of the > sprite each tick of the animation, just as in HtDP "world"? Functions like > move, rotate, etc. produce a modified sprite, and when that sprite gets > passed to

Re: [racket] FFI question: 0 microseconds returned from gettimeofday call

2011-07-15 Thread Thomas Chust
keyd...@gmx.de wrote: > [...] > Well in this case in fact, I was happy with the result, the 1 looked fine > given we're having daylight saving time :-; > [...] Hello Sigrid, sure the one is fine, but I think this field really never contains anything else than 1 when DST is in effect or 0 when it

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Jos Koot
-Original Message- From: users-boun...@racket-lang.org [ mailto:users-boun...@racket-lang.org] On Behalf Of Mark Engelberg Sent: viernes, 15 de julio de 2011 20:34 To: Sam Tobin-Hochstadt Cc: users list; Matthias Felleisen Subject: Re: [racket] Again

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Tom McNulty
Hi. > What kind of Racket editor operations would you like to see? A 'smart' find-replace for bindings would be useful. This suggestion would apply to DrRacket as well. - Tom _ For list-related administrative tasks: http://lists.racket-lan

Re: [racket] FFI question: 0 microseconds returned from gettimeofday call

2011-07-15 Thread Jon Zeppieri
On Fri, Jul 15, 2011 at 8:40 PM, Jon Zeppieri wrote: > > I *think* it's fairly > safe; it should always err on the side of passing in too large a chunk > of memory, so it shouldn't start stomping on random addresses. Just to be clear: the code isn't safe if the tolerances are too narrow. The code

Re: [racket] FFI question: 0 microseconds returned from gettimeofday call

2011-07-15 Thread Jon Zeppieri
On Fri, Jul 15, 2011 at 4:28 PM, keyd...@gmx.de wrote: [snip] >> >> There is, however, a PLaneT package (planet dherman/c:4:0) providing the >> facilities to parse header files and extract structure layout >> information like that required here using the system's C compiler. > > > Thanks for the

Re: [racket] FFI question: 0 microseconds returned from gettimeofday call

2011-07-15 Thread keyd...@gmx.de
Hi Thomas, thanks a lot for your quick answer! > :-/ Perhaps _long or _intptr would be a better choice than _int, since > they would adapt to the system's word size, which is more likely to be > right everywhere than _int that is always 32 bits wide, according to the > Racket documentation, but

Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Nadeem Abdul Hamid
On Fri, Jul 15, 2011 at 2:56 PM, Stephen Bloch wrote: > The problem is that some sprite actions (most obviously, "move" when you're > in pen-down mode) affect not only the sprite itself but the world's picture. > So far the least-bad solution I've come up with is to hide a mutation of > that pic

Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Carl Eastlund
On Fri, Jul 15, 2011 at 2:56 PM, Stephen Bloch wrote: > Last Monday I attended Dan Garcia's workshop on BYOB.  He kept pointing out > (presumably for the benefit of Emmanuel > and me) that it really is a functional language.  And yes, it has "map", > "filter", "foldl", and "lambda"... but most o

Re: [racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Matthias Felleisen
On Jul 15, 2011, at 2:56 PM, Stephen Bloch wrote: > I've experimented with a couple of ways to do that. One way is to define (in > my code, not visible to student code) a box named "world-pic", which is > set-box!ed in "move" and "run-byob-world". Another is to use just a plain > variable an

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Matthias Felleisen
On Jul 15, 2011, at 2:36 PM, Richard Lawrence wrote: > 1. An operation that I always find myself wanting is something like > ``wrap next sexp'' that would put parentheses around the next sexp and > position point inside the new open-parenthesis, in drracket: esc ctrl-k removes an S-expression, (

[racket] Advice: simulating stateful API in functional setting

2011-07-15 Thread Stephen Bloch
Last Monday I attended Dan Garcia's workshop on BYOB. He kept pointing out (presumably for the benefit of Emmanuel and me) that it really is a functional language. And yes, it has "map", "filter", "foldl", and "lambda"... but most of the examples and assignments one normally does in BYOB use v

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Richard Lawrence
Hi Neil, I am an Emacs user, but have so far stuck with DrRacket as I learn Racket; apologies if my suggestions are features that are already available in Quack/Meow. 1. An operation that I always find myself wanting is something like ``wrap next sexp'' that would put parentheses around the next

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Mark Engelberg
OK, so here are the main points I'm gathering from this discussion. 1. Clojure's quasiquote system does some extra things behind the scenes in terms of generating temporary variables and qualifying variable names with their namespace in such a way that the macros you write are reasonably hygienic

Re: [racket] Periodic calls to collect-garbage?

2011-07-15 Thread Matthew Flatt
At Fri, 15 Jul 2011 12:52:07 -0400, Stephen Chang wrote: > I dont know if this is related but the virtual machine runs out of > memory every time I run raco setup when compiling Racket (32 bit) from > scratch on my Windows 7 (64 bit) machine. Off-list, Stephen reports: > I have 12gb of ram and 4

Re: [racket] Periodic calls to collect-garbage?

2011-07-15 Thread Stephen Chang
> This sounds like a bug. Explicit calls to `collect-garbage' shouldn't > be needed for the garage collector to do its job. > > Does anyone know an easy way for me to make the problem happen, so I > can see what is going on? I dont know if this is related but the virtual machine runs out of memory

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Sam Tobin-Hochstadt
On Fri, Jul 15, 2011 at 10:17 AM, Matthias Felleisen wrote: > > 1. If they use gensym and gentemp in a reasonably systematic way, > > 2. and if they rule out scoped macros, I think you also need: 3. Prevent rebinding of anything with the package clojure/core. Also, ruling out scoped macros at t

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Matthias Felleisen
1. If they use gensym and gentemp in a reasonably systematic way, 2. and if they rule out scoped macros, THEN A. they get close to a hygienic expander B. they lose a lot of expressiveness compared to Racket. Try building something like class.rkt in Clojure and report back. __

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Stephan Houben
On 07/15/2011 02:07 PM, Thomas Chust wrote: yes, Clojure's mitigation strategy for avoiding hygiene problems has two components: The #-suffix syntax that acts as a clever shorthand for gensym and the `-quote syntax that employs reader magic to prefix every symbol read inside the syntax-quoted ex

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Sam Tobin-Hochstadt
On Fri, Jul 15, 2011 at 1:35 AM, Neil Van Dyke wrote: > > I'm also interested in ideas for language-specific operations, such as > Quack's command to toggle a form between "(define (X ...) ...)" and "(define > X (lambda (...) ...))".  Different people will want different of these > operations, and

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Thomas Chust
Eli Barzilay wrote: > Three hours ago, Mark Engelberg wrote: >> On Thu, Jul 14, 2011 at 4:35 AM, Thomas Chust wrote: >>> While Clojure *mitigates* the problems of non-hygienic macros >>> using namespaces and a shorthand syntax for freshly generated >>> identifiers, it doesn't *solve* the problems.

Re: [racket] what kind of Racket editor operations would you like to see?

2011-07-15 Thread Norman Gray
Greetings. On 2011 Jul 15, at 06:35, Neil Van Dyke wrote: > With the forthcoming Emacs mode for Racket, called Meow, I eagerly await it! > I intend to > provide a conventional typing interface and also some sexp-oriented > operations that people can adopt incrementally if they want. > ("me

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Stephan Houben
On 07/15/2011 05:40 AM, Mark Engelberg wrote: I would like to better understand how Clojure's mitigation strategy is insufficient. Since Eli's document is all about the while macro, let's look at Clojure's while macro. (defmacro while [test& body] `(loop [] (when ~test ~@body

Re: [racket] Again on bindings visibility in eval

2011-07-15 Thread Eli Barzilay
Three hours ago, Mark Engelberg wrote: > On Thu, Jul 14, 2011 at 4:35 AM, Thomas Chust wrote: > > While Clojure *mitigates* the problems of non-hygienic macros > > using namespaces and a shorthand syntax for freshly generated > > identifiers, it doesn't *solve* the problems. Racket's macro > > sys