On Fri, Jan 23, 2009 at 2:50 PM, Duncan Murdoch wrote:
> External pointers are the standard way to do that. You don't need to worry
> about reference counting, R's garbage collector will call a finalizer when
> it doesn't need the object any more.
>
> I think the usual example of this is the ROD
On 1/23/2009 1:47 PM, Yi Zhang wrote:
On Fri, Jan 23, 2009 at 5:15 AM, Patrick Burns wrote:
If I understand properly, you want '<-' to be
a generic function, which it currently isn't.
There may be a way to fake that (I can't think
of any).
But I'm wondering if you should rethink what
you want.
On Fri, Jan 23, 2009 at 9:40 AM, Wacek Kusnierczyk
wrote:
> you might want to specify what 'completely unrecoverable' means, and
> what approaches are allowed.
>
> for the former, i guess that:
> - 'incompletely recoverable' means that there is at least one function
> name in the global environme
On Fri, Jan 23, 2009 at 5:15 AM, Patrick Burns wrote:
> If I understand properly, you want '<-' to be
> a generic function, which it currently isn't.
> There may be a way to fake that (I can't think
> of any).
>
> But I'm wondering if you should rethink what
> you want. The only reason that I can
Duncan Murdoch wrote:
> Wacek Kusnierczyk wrote:
>> Duncan Murdoch wrote:
>>
>>> You can use parent.frame() as the pos or envir argument to assign(),
>>> and then the assignment happens in the caller's frame. And assign()
>>> is also another way out if you overwrite <- with something that
>>> d
Wacek Kusnierczyk wrote:
Duncan Murdoch wrote:
You can use parent.frame() as the pos or envir argument to assign(),
and then the assignment happens in the caller's frame. And assign()
is also another way out if you overwrite <- with something that
doesn't work; just call it to reassign base
If I understand properly, you want '<-' to be
a generic function, which it currently isn't.
There may be a way to fake that (I can't think
of any).
But I'm wondering if you should rethink what
you want. The only reason that I can think of
that you would want to change '<-' is because
of some ext
Duncan Murdoch wrote:
>
> You can use parent.frame() as the pos or envir argument to assign(),
> and then the assignment happens in the caller's frame. And assign()
> is also another way out if you overwrite <- with something that
> doesn't work; just call it to reassign base::`<-` to it. Or jus
On 22/01/2009 4:50 PM, Yi Zhang wrote:
i was sort-of joking, though it's a real option if you want it.
but seriously, there's no reason for the &%#* lamenting:
x <- 1
'<-' = function(x,y) 0
x <- 2
# 0
.Primitive('<-')(x,2)
x
# 2
base::'<-'(x, 3)
x
# 3
base::'<-'('<-', base::'<-')
x <- 4
x
#
> i was sort-of joking, though it's a real option if you want it.
>
> but seriously, there's no reason for the &%#* lamenting:
>
> x <- 1
> '<-' = function(x,y) 0
> x <- 2
> # 0
>
> .Primitive('<-')(x,2)
> x
> # 2
>
> base::'<-'(x, 3)
> x
> # 3
>
> base::'<-'('<-', base::'<-')
> x <- 4
> x
> # 4
>
Yi Zhang wrote:
>
# now what?? &%#*
>> now you are really motivated to use '=' instead of '<-':
>>
>> x = 3
>> x
>> # 3
>>
>> vQ
>>
>>
>
> Thanks. That certainly is an option. But I want to preserve `<-`'s
> functionality because I'm writing a package and I don't want to lim
On Thu, Jan 22, 2009 at 4:17 PM, Wacek Kusnierczyk
wrote:
> Duncan Murdoch wrote:
>> On 1/22/2009 2:41 PM, Yi Zhang wrote:
>>> Hi,
>>>
>>> I want to create an alias for the "<-" function and then later
>>> overwrite it. Any idea how I can get the "<-" function object? I know
>>> for other function
Duncan Murdoch wrote:
> On 1/22/2009 2:41 PM, Yi Zhang wrote:
>> Hi,
>>
>> I want to create an alias for the "<-" function and then later
>> overwrite it. Any idea how I can get the "<-" function object? I know
>> for other functions it's easy, something like "f <- seq" will do; how
>> really no cl
On Thu, Jan 22, 2009 at 3:06 PM, Duncan Murdoch wrote:
>
> get("<-") will give it to you, and
>
> `<-` <- function(x, y) cat("x=", x, "y=", y, "\n")
>
> will change it -- and will probably be the last effective thing you do in
> that session, unless you're really careful:
>
>> x <- 1
>> x
> [1] 1
On 1/22/2009 2:41 PM, Yi Zhang wrote:
Hi,
I want to create an alias for the "<-" function and then later
overwrite it. Any idea how I can get the "<-" function object? I know
for other functions it's easy, something like "f <- seq" will do; how
really no clue for this one. Thanks!
get("<-") wi
Is there many functions:
See:
grep("<-", ls("package:base"), value = TRUE)
For 'substring<-':
type `substring<-` in R
On Thu, Jan 22, 2009 at 5:41 PM, Yi Zhang wrote:
> Hi,
>
> I want to create an alias for the "<-" function and then later
> overwrite it. Any idea how I can get the "<-" fu
16 matches
Mail list logo