Skip to content
Prev 326131 / 398502 Next

Lexical scoping is not what I expect

On 28/06/2013 10:54 AM, John Fox wrote:
If we weren't allowed to change T and F, would we be allowed to change 
other "constants", like functions mean or max? If we couldn't change 
anything defined in the base package, would we be allowed to change 
things defined in other packages like stats or utils or graphics?  I 
think it's simply a matter of setting the line somewhere, and R has 
chosen to set it in the most permissive place that's reasonable.  It 
assumes that its users know what they are doing.

Why not allow changes to TRUE or Inf?   TRUE is a constant, whereas T is 
a variable containing TRUE.  Inf is also a constant, corresponding to a 
length one vector containing that value.  Those are treated by the 
parser like 2 or "hello".  It would be really bad if someone could 
change the meaning of 2 (though I hear some old Fortran compilers 
allowed that), but is it really so bad to allow someone to define their 
own plot function, or temperature variable named T?

Duncan Murdoch

Thread (27 messages)

David Kulp Lexical scoping is not what I expect Jun 24 Rui Barradas Lexical scoping is not what I expect Jun 24 Gabor Grothendieck Lexical scoping is not what I expect Jun 24 arun Lexical scoping is not what I expect Jun 24 Rolf Turner Lexical scoping is not what I expect Jun 24 Marc Schwartz Lexical scoping is not what I expect Jun 24 Duncan Murdoch Lexical scoping is not what I expect Jun 24 David Kulp Lexical scoping is not what I expect Jun 24 William Dunlap Lexical scoping is not what I expect Jun 24 Duncan Murdoch Lexical scoping is not what I expect Jun 25 S Ellison Lexical scoping is not what I expect Jun 26 Duncan Murdoch Lexical scoping is not what I expect Jun 26 Hadley Wickham Lexical scoping is not what I expect Jun 27 S Ellison Lexical scoping is not what I expect Jun 28 Duncan Murdoch Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 Duncan Murdoch Lexical scoping is not what I expect Jun 28 Brian Ripley Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 Rolf Turner Lexical scoping is not what I expect Jun 28 Yihui Xie Lexical scoping is not what I expect Jun 28 William Dunlap Lexical scoping is not what I expect Jun 29 Greg Snow Lexical scoping is not what I expect Jun 29 Rolf Turner Lexical scoping is not what I expect Jun 30 Duncan Murdoch Lexical scoping is not what I expect Jun 30 David Winsemius Lexical scoping is not what I expect Jun 30