Re: [R] Parallel assignments and goto

2018-02-27 Thread Thomas Mailund
I did try assign. That was the slowest version from what my profiling could tell, as far as I recall, which really surprised me. I had expected it to be the fastest. The second slowest was using the [[ operator on environments. Or it might be the reverse for those two. They were both slower

Re: [R] Parallel assignments and goto

2018-02-27 Thread Bert Gunter
No clue, but see ?assign perhaps if you have not done so already. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Feb 27, 2018 at 6:51 AM,

Re: [R] Parallel assignments and goto

2018-02-27 Thread Thomas Mailund
Interestingly, the <<- operator is also a lot faster than using a namespace explicitly, and only slightly slower than using <- with local variables, see below. But, surely, both must at some point insert values in a given environment — either the local one, for <-, or an enclosing one, for <<-

Re: [R] Parallel assignments and goto

2018-02-26 Thread Thomas Mailund
Following up on this attempt of implementing the tail-recursion optimisation — now that I’ve finally had the chance to look at it again — I find that non-local return implemented with callCC doesn’t actually incur much overhead once I do it more sensibly. I haven’t found a good way to handle

Re: [R] Parallel assignments and goto

2018-02-14 Thread Fox, John
Dear Thomas, This looks like a really interesting project, and I don't think that anyone responded to your message, though I may be mistaken. I took at a look at implementing parallel assignment, and came up with: passign <- function(..., envir=parent.frame()){ exprs <- list(...) vars

Re: [R] Parallel assignments and goto

2018-02-11 Thread Thomas Mailund
I admit I didn’t know about Recall, but you are right, there is no direct support for this tail-recursion optimisation. For good reasons — it would break a lot of NSE. I am not attempting to solve tail-recursion optimisation for all cases. That wouldn’t work by just rewriting functions. It

Re: [R] Parallel assignments and goto

2018-02-11 Thread David Winsemius
> On Feb 11, 2018, at 7:48 AM, Thomas Mailund wrote: > > Hi guys, > > I am working on some code for automatically translating recursive functions > into looping functions to implemented tail-recursion optimisations. See > https://github.com/mailund/tailr > > As a