Bug 412 - anomalies with call objects
Summary: anomalies with call objects
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Language (show other bugs)
Version: old
Hardware: All All
: P5 normal
Assignee: Jitterbug compatibility account
URL:
Depends on:
Blocks:
 
Reported: 2000-02-06 06:18 UTC by Jitterbug compatibility account
Modified: 2013-08-30 00:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2000-02-06 06:18:50 UTC
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>

Call objects don't always behave as you'd expect. They're mostly
list-like, but with exceptions:

> f<-function(x,y,...)match.call(expand.dots=FALSE)
> xx <- f(y=1,2,z=3,4)
> dd <- xx$...
> xx$... <- NULL
> c(xx,dd)
[[1]]
f(x = 2, y = 1)

$z
[1] 3

[[3]]
[1] 4

> as.call(c(as.list(xx),dd))
f(x = 2, y = 1, z = 3, 4)

(Splus has this rather differently, since dd becomes a call to list()
rather than a list of promises:

S> c(xx,dd)
f(x = 2, y = 1, list, z = 3, 4)
S> as.call(c(as.list(xx),dd))
f(x = 2, y = 1, list, z = 3, 4)

...but at least gives the same in both cases)

Also, the names of arguments added with [[<- is getting dropped if a
new element is required:

> xx[["abc"]]<-123
> xx
f(x = 2, y = 1, 123)

S has what I'd expect there:

S> xx[["abc"]]<-123
S> xx
f(x = 2, y = 1, abc = 123)

[R-0.99.0 prerelease on RedHat6.1, but this is likely not a new thing.]

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
Comment 1 Jitterbug compatibility account 2000-02-17 01:26:57 UTC
Audit (from Jitterbug):
Wed Feb 16 19:26:57 2000	ripley	moved from incoming to Language
Comment 2 Aleksey Vorona 2013-08-30 00:18:47 UTC
I know that it is an old bug, but it appears that half of it was fixed and can be closed. At least the last part. If I execute it in R 3.0.1:

> xx[["abc"]]<-123
> xx
f(x = 2, y = 1, abc = 123)

That is exactly as the reporter expected.

As for the call semantic, I think that it is way to late to change it.

Marking the bug "UNCOFIRMED" to attract some attention to it. I think it should be closed after review.