Re: [racket] Scheme Design Patterns

2013-09-14 Thread Chad A.
Well, that was a happy coincidence. Thank you for the explanation! -- Chad Albers http://www.neomantic.com (pgp signature available on request) On Wed, Sep 11, 2013 at 10:40 AM, Jay McCarthy wrote: > Luckily, you've asked the person who wrote that code! > > There's a few things going on here...

Re: [racket] Scheme Design Patterns

2013-09-10 Thread Chad A.
Thanks for your help. I was sure it would have something to do with capturing bindings in a closure, but the code in question seems to lack a closure. Maybe I'm missing something, though. Here's the code: https://github.com/plt/racket/blob/v5.3.4/collects/web-server/http/request.rkt#L102. Thank

Re: [racket] Scheme Design Patterns

2013-09-10 Thread Jay McCarthy
Luckily, you've asked the person who wrote that code! There's a few things going on here... 1. read-request is just provided for backwards compatibility, the Web server itself ONLY use make-ext:read-request (as renamed to make-read-request on line 23); for instance, see https://github.com/plt/rac

Re: [racket] Scheme Design Patterns

2013-09-10 Thread Jay McCarthy
I think more context would be useful to know why a specific case is useful. But, I'll do my best with none... By using functions like this, you can control when things happen and what they can see. For instance... (define (make-worker) (define a (build-list 10 add1) (define (worker) ;; a