Re: [racket] Delimited continuations and parameters

2012-05-15 Thread Matthias Felleisen
On May 15, 2012, at 3:11 PM, Asumu Takikawa wrote: > On 2012-05-15 10:49:20 -0400, Matthias Felleisen wrote: >> (parameterize ([p 1]) >> (λ (zzz) ;; <= INCLUDING THE parameterize r while >> not including parameterize p is an arbitrary choice > > I only included `

Re: [racket] Delimited continuations and parameters

2012-05-15 Thread Asumu Takikawa
On 2012-05-15 10:49:20 -0400, Matthias Felleisen wrote: >(parameterize ([p 1]) > (λ (zzz) ;; <= INCLUDING THE parameterize r while > not including parameterize p is an arbitrary choice I only included `r` because it is the only parameterization in the source cod

Re: [racket] Delimited continuations and parameters

2012-05-15 Thread Matthias Felleisen
TWO DISTINCT ISSUES: I have encoded the apparent first step in the reduction sequence via submodules. ISSUE 1: I am disturbed that submodule b is evaluated before submodule a. ISSUE 2: What is the semantics of parameterize? #lang racket (module a racket (require racket/control) (d

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Robby Findler
Oh, wait. Sorry. I got mixed up. Robby On Mon, May 14, 2012 at 9:26 PM, Robby Findler wrote: > Also, just in case it wasn't obvious all along, here's another one: > > #lang racket > > (require racket/control) > > (define p (make-parameter 0)) > (define r (make-parameter 0)) > > ((λ (f) >   (para

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Robby Findler
Also, just in case it wasn't obvious all along, here's another one: #lang racket (require racket/control) (define p (make-parameter 0)) (define r (make-parameter 0)) ((λ (f) (parameterize ([p 2]) (values (parameterize ([r 20]) (f 0) (parameterize ([p 1]) (reset

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Matthew Flatt
At Mon, 14 May 2012 21:50:01 -0400, Asumu Takikawa wrote: > On 2012-05-14 19:00:49 -0600, Matthew Flatt wrote: > > In other words, every `parameterize' uses the same continuation mark, > > so that `(parameterize ([r 10]) ...)' associates the parameterization > > continuation mark with a single reco

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Asumu Takikawa
On 2012-05-14 19:00:49 -0600, Matthew Flatt wrote: > In other words, every `parameterize' uses the same continuation mark, > so that `(parameterize ([r 10]) ...)' associates the parameterization > continuation mark with a single record that maps `r' to 10, `p' to 1, > etc. The entire record is carr

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Ryan Culpepper
On 05/14/2012 04:26 PM, Asumu Takikawa wrote: Hi all, Here is a code snippet that uses both delimited continuations and parameters (translated from the paper "Delimited Dynamic Binding"[1]): #lang racket (require racket/control) (define p (make-parameter 0)) (define r (make-parame

Re: [racket] Delimited continuations and parameters

2012-05-14 Thread Matthew Flatt
See the docs for `parameterize': If a continuation is captured during the evaluation of parameterize, invoking the continuation effectively re-introduces the parameterization, since a parameterization is associated to a continuation via a continuation mark (see Continuation Marks) using a pri

[racket] Delimited continuations and parameters

2012-05-14 Thread Asumu Takikawa
Hi all, Here is a code snippet that uses both delimited continuations and parameters (translated from the paper "Delimited Dynamic Binding"[1]): #lang racket (require racket/control) (define p (make-parameter 0)) (define r (make-parameter 0)) ((λ (f) (parameterize ([p 2])