[Rd] data(lh) time serie parameters

2008-03-30 Thread Jean lobry
Dear all, I'm confused by the time serie parameters in data(lh) : sueoka:~ lobry$ R --vanilla --quiet tsp(lh) [1] 1 48 1 because documentation says: QUOTE A regular time series giving the luteinizing hormone in blood samples at 10 mins intervals from a human female, 48 samples. UNQUOTE So

Re: [Rd] data(lh) time serie parameters

2008-03-30 Thread Gabor Grothendieck
On Sun, Mar 30, 2008 at 5:52 AM, Jean lobry [EMAIL PROTECTED] wrote: Dear all, I'm confused by the time serie parameters in data(lh) : sueoka:~ lobry$ R --vanilla --quiet tsp(lh) [1] 1 48 1 because documentation says: QUOTE A regular time series giving the luteinizing hormone in

[Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
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?

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread h . wickham
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?

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
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, [EMAIL PROTECTED] wrote: Would anyone like to

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
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

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Luke Tierney
On Sun, 30 Mar 2008, Gabor Grothendieck wrote: Also in trying it out again it seems that its not like on.exit but more like return: Yes -- if you can point out what in the documentation ever gave the idea it might be like on.exit then we can fix the documentation. F - function(f) { f(10);

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
Sorry it should be as follows: fib - function(i, a = 0, b = 1) { if (i == 0) b else fib(i-1, b, a+b) } Now, how do we transform that to use callCC? On Sun, Mar 30, 2008 at 1:42 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: OK. Can you show code to implement the tail recursive version of

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
I came across this in googling for continuations and was surprised when I found it in R 2.7.0 and since I had not come across it before I assumed it was added just now. Can you explain how its intended to be used with an example that is more realistic than in the example section. On Sun, Mar

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Luke Tierney
On Sun, 30 Mar 2008, Gabor Grothendieck 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. The article conflates basic CPS with

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
OK. Can you show code to implement the tail recursive version of fib using callCC in R, say. Here it is transformed to tail recursive style: fib - function(i, a = 0, b = 1) { if (i == 0) a else fib(i-1, b, a+b) Now, how do I add callCC to all this so that the fib call presumably does not

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Luke Tierney
On Sun, 30 Mar 2008, Gabor Grothendieck wrote: Sorry it should be as follows: fib - function(i, a = 0, b = 1) { if (i == 0) b else fib(i-1, b, a+b) } Now, how do we transform that to use callCC? On Sun, Mar 30, 2008 at 1:42 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: OK. Can you

Re: [Rd] callCC in 2.7.0

2008-03-30 Thread Gabor Grothendieck
Thanks. So its intended to jump straight out of deeply nested calls without having to manage the unwinding. On Sun, Mar 30, 2008 at 4:22 PM, Luke Tierney [EMAIL PROTECTED] wrote: On Sun, 30 Mar 2008, Gabor Grothendieck wrote: Sorry it should be as follows: fib - function(i, a = 0, b = 1)