Bug 15350 - Calls to infix functions with named args should deparse in prefix style
Calls to infix functions with named args should deparse in prefix style
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Language
R 3.0.0
All All
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-22 22:34 UTC by Peter Meilstrup
Modified: 2013-06-29 23:55 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 Peter Meilstrup 2013-06-22 22:34:13 UTC
Expressions e1 and e2 deparse identically but eval differently:

> e1 <- quote(`%o%`(Y=c(1,2), X=c(3,4)))
> e2 <- quote(`%o%`(c(1,2), c(3,4)))
> e1
c(1, 2) %o% c(3, 4)
> e2
c(1, 2) %o% c(3, 4)
> eval(e1)
     [,1] [,2]
[1,]    3    6
[2,]    4    8
> eval(e2)
     [,1] [,2]
[1,]    3    4
[2,]    6    8

It would be better if e1 deparsed explicitly as `%o%`(Y=c(1,2), X=c(3,4)) .
Comment 1 Duncan Murdoch 2013-06-29 23:55:53 UTC
Fixed in R-devel r63105.  Will port to R-patched soon.