From ggrothendieck at gmail.com  Sun Mar 30 18:58:08 2008
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sun, 30 Mar 2008 12:58:08 -0400
Subject: [Rd] callCC in 2.7.0
In-Reply-To: <971536df0803300934t4f354132od131d1f567652fd0@mail.gmail.com>
References: <971536df0803300710t40f61256x78b9889a5c323924@mail.gmail.com>
	<f8e6ff050803300904i1a950ed5r58738fb4184ccad0@mail.gmail.com>
	<971536df0803300934t4f354132od131d1f567652fd0@mail.gmail.com>
Message-ID: <971536df0803300958t2cca7f07w59746a388c0b488f@mail.gmail.com>

Also in trying it out again it seems that its not like
on.exit but more like return:

F <- function(f) { f(10); print(2); f(20); 3}
callCC(F)

acts the same as:

F <- function() { return(10); print(2); f(20); 3}
F()

and there is no documented way to restart F
at the point it left off so I assume it can't.

On Sun, Mar 30, 2008 at 12:34 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> I think the only relationship to that is the name since
> it does not appear to allow one to leave a function
> in the middle of its processing and re-enter it back
> at that point -- which is what would be needed.
>
>
> On Sun, Mar 30, 2008 at 12:04 PM,  <h.wickham at gmail.com> wrote:
> >
> > > Would anyone like to explain if callCC in R 2.7.0 gives
> > > anything that on.exit does not already provide?
> > >
> > > It seems that the exit condition once defined cannot
> > > be added to overridden whereas with on.exit multiple
> > > on.exit's add additional on.exits rather than being ignored.
> > >
> > > Is this important?
> >
> > It facilitates a completely different style of programming - see
> > http://en.wikipedia.org/wiki/Continuation-passing_style
> >
> > --
> > http://had.co.nz/
> >
>



[Rd] callCC in 2.7.0
Gabor Grothendieck