[Rd] more on bug 7924

Kevin B. Hendricks kevin.hendricks at sympatico.ca
Mon Jun 5 14:34:37 CEST 2006


Hi,

On Jun 5, 2006, at 8:02 AM, Peter Dalgaard wrote:

> Not quite: more like freshly-made-not-assigned,
> assigned-but-only-once, assigned-maybe-more-than-once.


So for my particular case ...

> call2 <- Quote(f(arg[[1]]))[c(1,2,2,2)]


> 0: 0x9e7d18 LANGSXP Object with length 1, named 1
>      f(arg[[1]], arg[[1]], arg[[1]])
> 1: 0xa2b488 SYMSXP  name at 0xa29408, value at 0x5087e0, named 0
>      f

> 1: 0x9e9880 LANGSXP Object with length 1, named 0
>      arg[[1]]
> 2: 0x508738 SYMSXP  name at 0x51c788, value at 0x527690, named 0
>      `[[`
> 2: 0xc37cc8 SYMSXP  name at 0xc376e8, value at 0x5087e0, named 0
>      arg
> 2: 0xf94cb8 REALSXP Object, length 1, starting at 0xf94ce0, named 0
>      1

> 1: 0x9e9880 LANGSXP Object with length 1, named 0
>      arg[[1]]
> 2: 0x508738 SYMSXP  name at 0x51c788, value at 0x527690, named 0
>      `[[`
> 2: 0xc37cc8 SYMSXP  name at 0xc376e8, value at 0x5087e0, named 0
>      arg
> 2: 0xf94cb8 REALSXP Object, length 1, starting at 0xf94ce0, named 0
>      1

> 1: 0x9e9880 LANGSXP Object with length 1, named 0
>      arg[[1]]
> 2: 0x508738 SYMSXP  name at 0x51c788, value at 0x527690, named 0
>      `[[`
> 2: 0xc37cc8 SYMSXP  name at 0xc376e8, value at 0x5087e0, named 0
>      arg
> 2: 0xf94cb8 REALSXP Object, length 1, starting at 0xf94ce0, named 0
>      1
>


The highest level LANGSXP list object has been named (1) but the sub  
LANGSXP object stored at 0x9e9880 is assigned to 3 places in the same  
top level LANGSXP list, and yet the named values of that subobject is  
0 (in all cases).

According to your descriptions above, I would consider this an  
"error" in setting named when the object is created?  Is my  
interpretation correct?

If so, for this particular case, I think that reused subobject should  
have had named = 2 since it is used in 3 places in the list?  What  
would be the proper setting for the named value for all of the  sub- 
sub- objects of that 0x9e9880 object?

Also what are the rules about having subobject with named = 2 inside  
a higher level object?  Should that force the higher level object  
named value to be 2 or can it stay 1?

Any help in understanding this would be greatly appreciated since I  
can not track down a bug when I am not sure what the "correct" values/ 
answers really should be and nothing in the R-lang.pdf or R-exts.pdf  
seem to explain this concept in any detail, especially for compound  
objects (it is much simpler to understand for objects that are just  
vectors of reals, integers, or strings, since there really is only  
one "object" that has a data area which stores all of the values (and  
AFAIK none of those stored ints, reals, or strings stored inside the  
vector object has a named property themselves).

So would someone please explain what the "proper" values for all of  
the named values for all of the objects in this "call2" object should  
be immediately after it is created.

Thanks,


Kevin



More information about the R-devel mailing list