[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] About the behavior of continuation in top-level begin form



Thanks, Jim! Actually, I already know that. 
I tried to put these expressions in let, lambda ... , and in these situations, there's no ambiguity.
But the problem of begin, as I said before, is still there. 
I don't think it's good to deliberately leave that behavior unspecified in the standard, so I post it here (for me, it creates unnecessary misunderstandings).
so, what do think of it ;D ?


2013/4/18 Jim Rees <jimreesma@x>

If you want a more predictable effect, do this instead:

(define cc #f)
(define (f) (call/cc (lambda (k) (set! cc k))) (display "Will you catch me?\n"))
(f)
(cc)





On Wed, Apr 17, 2013 at 12:56 PM, 張書瀚 <zrqsmcx@x> wrote:
Here is the bug-report link. In that post I use a more redundant example, but the idea is the same.
http://bugs.racket-lang.org/query/?cmd=view&pr=13701

And here is the mails: 

[Me to Matthew Flatt]
Hello! 
  Thanks for your answer! But I am more confused: 
  1 Both the newest version of Chez/Ypsilon Scheme give [Do you catch me?] output. 
  2 Both of them claim that their implementation confirm to the newest r6rs standard.
  3 Are they all wrong? Or is Racket intend not to compatible with r6rs in this point(If the answer is 'yes', what're the benefits)?


[Matthew Flatt to Me]
  I don't think that R6RS is clear on the point of splicing `begin's or
on the continuation of a module body. Even within what is specified,
it's possible that Racket's R6RS implementation doesn't handle `begin'
spliciing according to the standard.

Meanwhile, as you say, `racket' is a different language, and we've
chosen a simpler and more consistent rule for `begin' splicing (i.e.,
always splice). The `racket' language also takes advantage of prompts
to enable local reasoning about continuations in a module (i.e., you
don't have to wonder about the continuation of a module body's
evaluation, which is difficult to specify).




2013/4/18 張書瀚 <zrqsmcx@x>
Hi everyone! 

Here is the source code:

(define cc #f)
(begin (call/cc (lambda(k) (set! cc k))) (display "Will you catch me?\n"))
(cc)

In newest Racket, (cc) => nothing
In newest Chez/Ypsilon (cc) => Will you catch me?\n

I asked an expert about this, and he said that Chez/Ypsilon is right.

Then I post a bug report to Racket, Matthew Flatt said 
[R6RS isn't clear on the point of splicing `begin's or 
on the continuation of a module body.]

Then I checked r7rs-small-draft-9, I believe there is some ambiguity here.
What do you think about this problem? 
Actually I am a Scheme newbie, I apologize if this problem doesn't make any sense.




_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports



_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports