> > These are obvious toy examples, but it is a real problem
> > if you want to create a class that defines names or length
> > in a meaningful way, that is incompatible with the
> > underlying data structure.
>
> Yes indeed, (and "well know").
> I'm arguing that in such a situation
Sorry to anyone reading this and being confused by my response: it was
meant to be a response to a different message.
Duncan Murdoch
On 13-06-19 6:53 PM, Duncan Murdoch wrote:
On 13-06-19 4:44 PM, Hadley Wickham wrote:
Hi all,
Because str uses the generic version of length and names, it's
c
> Hadley Wickham
> on Wed, 19 Jun 2013 15:44:05 -0500 writes:
> Hi all, Because str uses the generic version of length and
> names, it's currently very easy to create objects that
> break str:
> a <- structure(list(1:5), class = "a")
> length.a <- function(x) 2L
On 13-06-19 4:44 PM, Hadley Wickham wrote:
Hi all,
Because str uses the generic version of length and names, it's
currently very easy to create objects that break str:
a <- structure(list(1:5), class = "a")
length.a <- function(x) 2L
str(a)
b <- structure(list(1:5), class = "b")
names.b <- fu
Hi all,
Because str uses the generic version of length and names, it's
currently very easy to create objects that break str:
a <- structure(list(1:5), class = "a")
length.a <- function(x) 2L
str(a)
b <- structure(list(1:5), class = "b")
names.b <- function(x) character()
str(b)
These are obv