[plt-scheme] call/cc behavior in gambit-c vs. plt-scheme

From: Cristian Baboi (cristi at ot.onrc.ro)
Date: Wed Jun 11 06:29:03 EDT 2008

I think you are right. I tryed this:

(define (call/ccc x) (call-with-current-continuation x))

(define coco 1)
(define (run)
  (begin
   (display "begin") (newline)
   (call/ccc (lambda (c) (set! coco c)))
   (display "again") (newline)
   (display "end") (newline)
  )
)


(run)
(coco 13)

and this time I've got:
- mzscheme:
begin
again
end
again
end

- gambit-c:
begin
again
end
again
end
again
end
again
end
again
end
....



On Wed, 11 Jun 2008 13:03:06 +0300, Filipe Cabecinhas <filcab at gmail.com>  
wrote:

> Hi,
>
> I'm no expert, but I'll give you my interpretation.
>
> I think the difference is because mzscheme has a delimited continuation  
> at the top-level so you can't capture anything beyond that with call/cc.  
> And I suppose it will also "merge" the begin with the top-level (making  
> it a no-op) so you won't even get the "again\nend" twice.
>
> But you better wait for a reply from someone that knows mzscheme better  
> :-)
>
>    - Filipe Cabecinhas
>


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Servers.
  part000.txt - is OK
http://www.eset.com


Posted on the users mailing list.