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=13701And 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 oron 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'vechosen a simpler and more consistent rule for `begin' splicing (i.e.,always splice). The `racket' language also takes advantage of promptsto enable local reasoning about continuations in a module (i.e., youdon't have to wonder about the continuation of a module body'sevaluation, 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) => nothingIn newest Chez/Ypsilon (cc) => Will you catch me?\nI 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 oron 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 mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports