Scope, assumptions, asksign, context. Was Re: Bug in Maxima 5.30.0
Subject: Scope, assumptions, asksign, context. Was Re: Bug in Maxima 5.30.0
From: Stavros Macrakis
Date: Wed, 4 Sep 2013 14:36:51 -0400
On Wed, Sep 4, 2013 at 12:42 PM, Robert Dodier <robert.dodier at gmail.com>wrote:
> On 2013-09-03, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
>
> >
> ...
> Do you have to do the explicit
> > manipulation of environments that you have to do in say R? Getting that
> > sort of thing right is far from trivial.
>
> I know something about R but I wonder to what you're referring about
> explicit environment manipulation.
> ...
>
Quick partial answer: take a look at the R functions environment,
parent.env, parent.frame, ....
For an example of a difficult-to-solve problem, see this email
chain<https://groups.google.com/forum/#!topic/manipulatr/Jr7S_1GX5Yk>
where
I reported a bug in the plyr package. The implementor's answer was:
This is actually a really challenging problem to solve because of the mix
of dynamic and lexical scoping. One work around is ...
I have tried to fix it properly once only to fail. lapply works around the
problem by manually constructing and evaluating calls at the C-level, which
I'd really rather avoid.
As far as I know, 2 years later, it has not been resolved. In this case, I
think the desired semantics are pretty clear, but the implementation is
difficult in the R framework.
-s