Re: [R] recover lost global function

2012-04-05 Thread Sam Steingold
> * [2012-04-05 09:58:24 -0500]: > > I'll look into whether thechecking can be made to take this into > account; it may be more trouble than it is worth though. Just to clarify: it would be nice if R noticed "stupid mistakes" like overriding functions in packages from the top-level and either pr

Re: [R] recover lost global function

2012-04-05 Thread luke-tierney
The compiler doesn't currently look beyond the first definition found (the generated code does the right thing, but the compiler won't optimize calls to functions masked by non-functions). I'll look into whether thechecking can be made to take this into account; it may be more trouble than it is

Re: [R] recover lost global function

2012-04-05 Thread MacQueen, Don
To expand on Duncan's answer, you haven't replaced it. The following should make that clear: ## starting in a fresh session > c function (..., recursive = FALSE) .Primitive("c") > find('c') [1] "package:base" > c <- 1 > find('c') [1] ".GlobalEnv" "package:base" > c [1] 1 > rm(c) > find('c') [1]

Re: [R] recover lost global function

2012-04-05 Thread Sam Steingold
> * Duncan Murdoch [2012-04-04 21:46:57 -0400]: > > On 12-04-04 5:15 PM, Sam Steingold wrote: >>> * Duncan Murdoch [2012-04-04 17:00:32 -0400]: >>> >>> There's no warning when you mask a function with a non-function at top >>> level, and little need for one, because R does the right search based

Re: [R] recover lost global function

2012-04-04 Thread Duncan Murdoch
On 12-04-04 5:15 PM, Sam Steingold wrote: * Duncan Murdoch [2012-04-04 17:00:32 -0400]: There's no warning when you mask a function with a non-function at top level, and little need for one, because R does the right search based on the fact that you're making a function call: c [1] 1 c(1,2)

Re: [R] recover lost global function

2012-04-04 Thread Sam Steingold
> * Duncan Murdoch [2012-04-04 17:00:32 -0400]: > > There's no warning when you mask a function with a non-function at top > level, and little need for one, because R does the right search based on > the fact that you're making a function call: > >> c > [1] 1 >> c(1,2) > [1] 1 2 why then am I get

Re: [R] recover lost global function

2012-04-04 Thread Sam Steingold
> * Duncan Murdoch [2012-04-04 17:00:32 -0400]: > > There's no warning when you mask a function with a non-function at top > level, and little need for one, because R does the right search based on > the fact that you're making a function call: > >> c > [1] 1 >> c(1,2) > [1] 1 2 why then am I get

Re: [R] recover lost global function

2012-04-04 Thread Duncan Murdoch
On 12-04-04 4:52 PM, Sam Steingold wrote: Since R has the same namespace for functions and variables, c<- 1 kills the global function, which can be restored by c<- get("c",mode="function") Is there a way to prevent R from overriding globals or at least warning when I do that or at least warn

[R] recover lost global function

2012-04-04 Thread Sam Steingold
Since R has the same namespace for functions and variables, > c <- 1 kills the global function, which can be restored by > c <- get("c",mode="function") Is there a way to prevent R from overriding globals or at least warning when I do that or at least warning when I replace a functional value with