[racket] begin vs +

2010-08-02 Thread Keiko Nakata
Hello, This code prints "hi" twice, (define d (box #f)) (+ (begin (let/cc k (begin (set-box! d k) 3))) (begin (print "hi") 9)) ((unbox d) 0) whereas this prints "hi" once (define d (box #f)) (begin (begin (let/cc k (begin (set-box! d k) 3))) (print "hi")) ((unbox d) 0) Why? Keiko __

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
From: Matthew Flatt > Each form at the top level is wrapped in a prompt, and the content of a > top-level `begin' is spliced into the top level. I see. Otherwise it should diverge. Thanks, Keiko _ For list-related administrative tasks: http://

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
Actually, I didn't see. Why this code (let ([d (box #f)] [a (box 0)]) (print (+ (begin (let/cc k (begin (set-box! d k) (set-box! a 2) 3))) (unbox a))) ((unbox d) 9)) prints 5, rather than 5999? Keiko _ For list-related administ

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
Hi, From: Matthew Flatt > At Mon, 02 Aug 2010 21:54:54 +0900 (JST), Keiko Nakata wrote: > > Why this code > > > > (let ([d (box #f)] [a (box 0)]) > > (print (+ (begin (let/cc k (begin (set-box! d k) (set-box! a 2) 3))) > > (unbox > > a))) > &g

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
From: Laurent > Maybe you could use `(let () *body ...*)' instead? It should be closer to > your intentions. Can you tweak my code (let ([d (box #f)] [a (box 0)]) (print (+ (begin (let/cc k (begin (set-box! d k) (set-box! a 2) 3))) (unbox a))) ((unbox d) 9)) or give me a hint, so that it

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
From: Sam Tobin-Hochstadt > On Mon, Aug 2, 2010 at 9:48 AM, Keiko Nakata > wrote: > > Or, call/cc does not capture the state? > > `call/cc' does not capture the state of the heap (such as the contents > of boxes). Thanks! This makes it very clear. This should als

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
I may think how call/cc should deal with delay's (call-by-need) is a moot point (theory vs implementation). Keiko From: Matthias Felleisen Subject: Re: [racket] begin vs + Date: Mon, 2 Aug 2010 10:00:39 -0400 > > call/cc captures the environment when it creates a procedural representation > o

Re: [racket] begin vs +

2010-08-02 Thread Keiko Nakata
From: "Jos Koot" > Calling a continuation does not undo side effects. This seems to be at the base line. Keiko _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

[racket] discarding initialization with delay + reset

2010-10-18 Thread Keiko Nakata
Hello, Can I regard this behavior as intended semantics? (let* ([x0 (delay (control k I))] [x1 (delay (force x0))]) (reset (force x1)) (force x1) 0) raises an error 'force: reentrant promise x1'. I speculate that an operation of 'update x1' is captured therefore discarded. But how this

Re: [racket] discarding initialization with delay + reset

2010-10-18 Thread Keiko Nakata
>> I speculate that an operation of 'update x1' is captured therefore >> discarded. But how this is implemented? Do you have a reference >> implementation or something that I can consult? > > Do what Matthias suggested -- but the code in question is pretty > tricky. You can also browse the srfi

[racket] iterative lazy space-safe or not?

2010-11-15 Thread Keiko Nakata
Hi, In the post-finalization discussion on iterative lazy algorithms (SRFI 45), (http://srfi.schemers.org/srfi-45/post-mail-archive/msg00024.html) Andre van Tonder points that Eli's proposal, which I think is used in Racket roughly, is not memory safe. But I do not get his point. (force (letrec

Re: [racket] iterative lazy space-safe or not?

2010-11-15 Thread Keiko Nakata
ago, Keiko Nakata wrote: > > Hi, > > > > In the post-finalization discussion on iterative lazy algorithms (SRFI 45), > > (http://srfi.schemers.org/srfi-45/post-mail-archive/msg00024.html) > > Andre van Tonder points that Eli's proposal, > > which I think i

Re: [racket] iterative lazy space-safe or not?

2010-11-16 Thread Keiko Nakata
> > It looks clever. > > I'm not sure that it's a good term -- you've seen the comment above > it? Sure. I read the source, papers by R. Jones and Wadler. I thought you have measurement. It's simple and works, which is nice; isn't it? Keiko _ Fo

Re: [racket] iterative lazy space-safe or not?

2010-11-17 Thread Keiko Nakata
Hi, > I don't have any concrete measurements. The implementation is as fast > as I could make it, but it's still pretty slow -- for example, when > you compare it with a naive implementation. Naive implementation --- do you mean non-composable promises (i.e. delays) or graph reductions (or ST

Re: [racket] iterative lazy space-safe or not?

2010-11-17 Thread Keiko Nakata
From: Eli Barzilay > > > Most of the hit is due to doing the right thing wrt exceptions: > > > when there's an exception when a promise is forced, the exception > > > is stored as the "value" and will be re-raised when forced again. > > > > Yes. I believe this is right thing to do and I think (or

Re: [racket] iterative lazy space-safe or not?

2010-11-17 Thread Keiko Nakata
> > I do not think I'll be willing to give up this semantics > > of memorizing exceptional behavior. > > I probably wouldn't mind giving it up, but the problems that it leads > to tend to be much more significant in the lazy language. What do you mean by "the problems that it leads to tend to be

Re: [racket] iterative lazy space-safe or not?

2010-11-18 Thread Keiko Nakata
// Maybe I should go off-list if this is only of interest to two of us... Here is what I've found in OCaml, Scala and F#. (They are not latest release, though. I used REPL.) I didn't get what I thought from Scala. OCaml (3.11.2): Exception memorized, black hole is an exception # let x = ref 0;;

Re: [racket] iterative lazy space-safe or not?

2010-11-18 Thread Keiko Nakata
> Well, think about `delay' as it's used in most Scheme implementations: > you use it in specific contexts where usually you know in advance that > you're not worried about exceptions -- if an exception always > indicates a bug, then it doesn't matter that forcing some promise > throws an exception

[racket] raise-ing an exception inside prompt

2010-12-22 Thread Keiko Nakata
Hello, How should I understand this behavior? (with-handlers ([(lambda (_) #t) (lambda (_) (print "exit"))]) (print (+ (prompt (print "hi") (raise 3) (print "bye")) 10))) prints "hi" then "exit", whereas (+ (prompt (print "hi") (raise 3) (print "bye")) 10) prints "hi", then I got an uncaught

Re: [racket] raise-ing an exception inside prompt

2010-12-22 Thread Keiko Nakata
ption inside prompt Date: Wed, 22 Dec 2010 12:15:21 -0500 > > Replace print with displayln. (You're buffering the output but it isn't > displayed until the repl prints the next prompt.) > > > On Dec 22, 2010, at 11:56 AM, Keiko Nakata wrote: > > > He

Re: [racket] raise-ing an exception inside prompt

2010-12-22 Thread Keiko Nakata
From: Robby Findler Subject: Re: [racket] raise-ing an exception inside prompt Date: Wed, 22 Dec 2010 11:46:49 -0600 > No, prompt doesn't do that. > > This boils down to what the default uncaught-exception-handler does, which is: > > (abort-current-continuation (default-continuation-prompt-ta

[racket] continuation barrier in raise

2011-01-05 Thread Keiko Nakata
Hello, Will someone give me an example which shows the continuation barrier introduced by 'raise'? I.e., I want an program which raises an exception because of the barrier. I think I do not understand the documentation properly, so have been failing to produce such an example myself... Keik

Re: [racket] continuation barrier in raise

2011-01-05 Thread Keiko Nakata
Thanks for the code. I'm a bit confused as replacing 'call-with-exception-handler' by 'with-handlers' seem to not produce the same bahavior: (call-with-continuation-prompt (lambda () (with-handlers ([(lambda (_) true) (lambda (_) (call-with-current-continuation (lambda (k) (abor

[racket] raise vs abort

2011-01-05 Thread Keiko Nakata
Hi again, I'm not sure where to ask this question, but why are 'raise' and 'abort' implemented separately (rather than, say, 'raise' by means of 'abort')? I haven't understood the implementations of these primitives, but they appear very different (in error.c and fun.c). Will someone explain to m

Re: [racket] raise vs abort

2011-01-05 Thread Keiko Nakata
t does the interesting control. > > Robby > > On Wed, Jan 5, 2011 at 7:58 AM, Keiko Nakata > wrote: > > Hi again, > > > > I'm not sure where to ask this question, but > > why are 'raise' and 'abort' implemented separately > > (

Re: [racket] continuation barrier in raise

2011-01-05 Thread Keiko Nakata
> A `with-handlers' handler and a `call-with-exception-handler' handler > are invoked with different continuations. A `with-handlers' handler is > invoked with the continuation of the entire `with-handlers' > expression; a `call-with-exception-handler' handler is invoked with > the continuation of

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
> I don't think you could rebuild the > missing portion of the continuation by reinstalling it before calling > the exception handler due to dynamic-wind frames, which could notice > the exit and re-entry, and continuation barriers, which could prevent > reinstallation. Something along this: (wi

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
> I'm not completely clear, but I think the only point is that 'raise' > does not, in general, actually abort. It calls a handler that makes > the decision to abort or not. When aborting actually happens, however, > abort is what does the aborting. Hmm. If I understand, you are saying that 'raise'

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
From: Casey Klein > Now I'm not sure I understand what you're trying to do. I think I am getting confused by my own questions and the wealth of the information I am getting from the list. Anyway, I thank you for the feedbacks. Keiko _ For list

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
On Thu, Jan 6, 2011 at 3:20 PM, Casey Klein wrote: > > Still I am not certain that this behavior of 'raise' cannot be implemented > > by other (delimited) control operators. And, probably I do not still > > understand why 'raise' has to be a primitive. > > It can be implemented in terms of conti

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
On Thu, Jan 6, 2011 at 3:29 PM, Robby Findler wrote: > If you wanted to try, I'd suggest adapting the redex model and then > using random testing to try to find the difference. 'By adapting the redex model' means to implement those operators discussed above in the redex? Then I first need

Re: [racket] raise vs abort

2011-01-06 Thread Keiko Nakata
So, I fall back into the same question of why 'raise' has to be a primitive, given > >> It can be implemented in terms of continuation marks (if you know the > >> key for exception handlers). But, On Thu, Jan 6, 2011 at 3:29 PM, Robby Findler wrote: > Probably you can get very close if not

[racket] ETAPS 2012 Call for Satellite Events

2011-02-16 Thread Keiko Nakata
ETAPS 2003: http://www.mimuw.edu.pl/etaps03/ -- IMPORTANT DATES -- Satellite event proposals deadline: 6 March 2011. Notification of acceptance: 13 March 2011. -- FURTHER INFORMATION AND ENQUIRIES -- Please contact Keiko Nakata or Tarmo Uustalu, etaps12-w...

[racket] [ANN] SOS 2011: Call for Papers

2011-03-17 Thread Keiko Nakata
Committee - Luca Aceto (Reykjavik, IS) Simon Bliudze (CEA LIST, FR) Filippo Bonchi (ENS Lyon & CNRS, FR) Fabio Gadducci (Pisa, IT) Matthew Hennessy (Dublin, IE) Bartek Klin (Warsaw, PL) Keiko Nakata (Talinn, EE) Michel Reniers (Eindhoven, NL, co-chair) Pawel Sobocinski (Southampton, UK, co-cha

[racket] [ANN] SOS 2011: 2nd Call for Papers

2011-05-16 Thread Keiko Nakata
NRS, FR) Fabio Gadducci (Pisa, IT) Matthew Hennessy (Dublin, IE) Bartek Klin (Warsaw, PL) Keiko Nakata (Talinn, EE) Michel Reniers (Eindhoven, NL, co-chair) Pawel Sobocinski (Southampton, UK, co-chair) Sam Staton (Cambridge, UK) Daniele Varacca (Paris 7, FR) Important Dates --- Submissi

[racket] PEPM 2015: First call for papers

2014-07-19 Thread Keiko Nakata
Sciences, Russia) Michael Leuschel (University of Dusseldorf, Germany) Sam Lindley (University of Edinburgh, UK) Michal Moskal (Microsoft Research, USA) Keiko Nakata (Tallinn University of Technology, Estonia) Jeremy Siek (Indiana University, USA) Peter Thiemann (University o