Re: [Rd] Defining an iterator

2009-01-25 Thread Stavros Macrakis
Thank you for your helpful reply, which clarified several issues for me. -s __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Defining an iterator

2009-01-25 Thread luke
On Sun, 25 Jan 2009, John Chambers wrote: It's unclear from your mail what you actually tried to do, but here are a few comments that may be relevant. The syntactic form for() is indeed implemented as a primitive function. Some primitives can and are used as generic functions, but `for` is no

Re: [Rd] Defining an iterator

2009-01-25 Thread Martin Morgan
Stavros Macrakis writes: > Inspired by Rudolf Biczok's query of Fri, Jan 23, 2009 at 1:25 AM, I > tried to implement iteration in a generic way using S4. (Though I am > admittedly still struggling with learning S4.) > >> setClass("foo",representation(bar="list")) > [1] "foo" >> x<-new("foo",bar=l

Re: [Rd] Defining an iterator

2009-01-25 Thread John Chambers
It's unclear from your mail what you actually tried to do, but here are a few comments that may be relevant. The syntactic form for() is indeed implemented as a primitive function. Some primitives can and are used as generic functions, but `for` is not currently one of them. > setGeneric("f

[Rd] Defining an iterator

2009-01-25 Thread Stavros Macrakis
Inspired by Rudolf Biczok's query of Fri, Jan 23, 2009 at 1:25 AM, I tried to implement iteration in a generic way using S4. (Though I am admittedly still struggling with learning S4.) > setClass("foo",representation(bar="list")) [1] "foo" > x<-new("foo",bar=list(1,2,3)) Given this, I would not e