[Rd] topenv of emptyenv

2019-03-23 Thread Konrad Rudolph
.4 but I can’t find an indication that this behaviour was ever changed. Cheers -- Konrad Rudolph __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] topenv of emptyenv

2019-03-28 Thread Konrad Rudolph
On Thu, Mar 28, 2019 at 11:42 AM Martin Maechler wrote: > So from that definition it must return .Globalenv in this > particular case. Indeed, that makes sense. Apparently the note wasn’t explicit enough for me to make the connection. -- Konrad R

[Rd] S3 lookup rules changed in R 3.6.1

2019-10-09 Thread Konrad Rudolph
the code for `registerS3method` explicitly supports non-package namespace environments. Unfortunately this workaround is not satisfactory because pretending that the environment is a package namespace, when it really isn’t, might break other things. [1] See r75

Re: [Rd] S3 lookup rules changed in R 3.6.1

2019-10-10 Thread Konrad Rudolph
), which even explicitly mentions non-namespace environments. [1] https://github.com/klmr/modules/issues/147 On Wed, Oct 9, 2019 at 11:23 PM Duncan Murdoch wrote: > On 09/10/2019 3:22 p.m., Konrad Rudolph wrote: > > tl;dr: S3 lookup no longer works in custom non-namespace environment

[Rd] Operator precedence of =, <- and ?

2020-01-10 Thread Konrad Rudolph
ion? Or is the documentation “correct”, and there’s a bug in the parser (in some versions of R)? [1] < https://stackoverflow.com/questions/1741820/51564252#comment105506343_51564252 > [2] < https://github.com/wch/r-source/blob/386c3a93cbcaf95017fa6ae52453530fb95149f4/src/main/

[Rd] How do I reliably and efficiently hash a function?

2015-12-10 Thread Konrad Rudolph
I’ve got the following scenario: I need to store information about an R function, and retrieve it at a later point. In other programming languages I’d implement this using a dictionary with the functions as keys. In R, I’d usually use `attr(f, 'some-name')`. However, for my purposes I do not want t

Re: [Rd] How do I reliably and efficiently hash a function?

2015-12-11 Thread Konrad Rudolph
t; > best, > Mark > > > Op vr 11 dec. 2015 om 03:27 schreef Charles C. Berry : >> >> On Thu, 10 Dec 2015, Konrad Rudolph wrote: >> >> > I’ve got the following scenario: I need to store information about an >> > R function, and retrieve it at a later

Re: [Rd] How do I reliably and efficiently hash a function?

2015-12-11 Thread Konrad Rudolph
@Jeroen, here’s what I’m solving with my hacking the parent environment chain: I’m essentially re-implementing `base::attach` — except that I’m attaching objects *locally* in the function instead of globally. I don’t think this can be done in any way except by modifying the parent environment chain

Re: [Rd] How do I reliably and efficiently hash a function?

2015-12-11 Thread Konrad Rudolph
On Fri, Dec 11, 2015 at 1:26 PM, Hadley Wickham wrote: > Why not use your own S3 class? Yes, I’ll probably do that. Thanks. I honestly don’t know why I hadn’t thought of that before, since I’m doing the exact same thing in another context [1]. [1]: https://github.com/klmr/decorator/blob/2742b39

Re: [Rd] On implementing zero-overhead code reuse

2016-10-04 Thread Konrad Rudolph
Check out ‹klmr/modules› on Github (distinct from CRAN’s ‹modules›!). It looks pretty much exactly like what you want: https://github.com/klmr/modules It has an extensive README and vignette explaining the usage. Cheers, Konrad -- Konrad Rudolph On Sun, 2 Oct 2016 at 18:31 Kynn Jones wrote

[Rd] Calling a replacement function in a custom environment

2023-08-27 Thread Konrad Rudolph
subsetting the defining environment, as shown above? Cheers, Konrad -- Konrad Rudolph // @klmr [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] [External] Re: Calling a replacement function in a custom environment

2023-08-28 Thread Konrad Rudolph
ul code. Cheers, Konrad -- Konrad Rudolph // @klmr [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] RFC: API design of package "modules"

2014-04-28 Thread Konrad Rudolph
Some time ago I’ve published the first draft of the package “modules” [1] which aims to provide a module system as an alternative to packages for R. Very briefly, this is aimed to complement the existing package system for very small code units which do not require the (small, but existing) overhea

Re: [Rd] Is the tcltk failure in affylmGUI related to R bug 15957

2015-01-26 Thread Konrad Rudolph
Just as an FYI, I suspect the sudden break is connected to a bug report I filed some time ago [1], and a subsequent fix by Duncan. Long story short, the previous behaviour of tcltk was actually buggy. The fix changed this behaviour to what Peter has explained, with the unintended consequence of bre