Re: [Rd] attributes on symbols

2017-08-11 Thread Lionel Henry
It's probably better to make it a runtime error, but note that it's not necessarily a bad idea to add attributes to singleton symbols. Those are used in Emacs Lisp for a variety of purposes. They just need strong conventions (part of that is that in Emacs many symbols are prefixed with a "namespace

Re: [Rd] attributes on symbols

2017-08-11 Thread Tomas Kalibera
Thanks for spotting this issue. The short answer is yes, adding attributes to a symbol is a bad idea and will be turned into a runtime error soon. Maintainers of packages that add attributes to symbols have been notified and some have already fixed their code. At least in one case the packag

Re: [Rd] attributes on symbols

2017-07-08 Thread Radford Neal
Attributes on symbols seem like a bad idea to me. An additional obscure part of the global state seems undesirable. I can't see how any use of them would be preferrable to storing an environment in some global variable, in which the same information could be recorded. Note that the attributes on

Re: [Rd] attributes on symbols

2017-07-07 Thread Torsten Hothorn
Here is a simpler example: ex <- as.name("a") attr(ex, "test") <- 1 quote(a) a attr(,"test") [1] 1 Torsten On Thu, 6 Jul 2017, William Dunlap wrote: The multcomp package has code in multcomp:::expression2coef that attaches the 'coef' attribute to symbols.  Since there is only one symbol o

[Rd] attributes on symbols

2017-07-06 Thread William Dunlap via R-devel
The multcomp package has code in multcomp:::expression2coef that attaches the 'coef' attribute to symbols. Since there is only one symbol object in a session with a given name, this means that this attaching has a global effect. Should this be quietly allowed or should there be a warning or an er