Bug 15715 - make call() more flexible
Summary: make call() more flexible
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Language (show other bugs)
Version: R-devel (trunk)
Hardware: Other Linux
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-03-15 15:02 UTC by Michael Lawrence
Modified: 2014-03-15 15:02 UTC (History)
0 users

See Also:


Attachments
Patch converting call to BUILTIN and adding support for symbols and functions (3.93 KB, patch)
2014-03-15 15:02 UTC, Michael Lawrence
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Lawrence 2014-03-15 15:02:46 UTC
Created attachment 1580 [details]
Patch converting call to BUILTIN and adding support for symbols and functions

The attached patch changes call() from a SPECIAL to a BUILTIN and adds support for passing a symbol or function as the 'name' argument. 

The change to a BUILTIN was initially motivated by the (undocumented) lack of support for "...", i.e.,

> fun <- function(...) call("paste", ...)
> fun("a", "b")
Error in fun("a", "b") (from #1) : '...' used in an incorrect context

Combined with the fact that call() was just evaluating its arguments anyway.

Adding support for symbol and function as the name argument just makes sense (well at least for symbols) and avoids the need to refer the user to as.call().