Boost logo

Proto :

Subject: Re: [proto] grammars, domains and subdomains
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2010-12-10 11:06:35

Eric Niebler wrote:

> On 12/10/2010 3:23 AM, Thomas Heller wrote:
>> However, the solution I am looking for is different.
>> The sub-domain i tried to define should also extend its super domain, BUT
>> expressions valid in this sub-domain should not be valid in the super
>> domain, only in the sub-domain itself.
> Because you don't want phoenix::_a to be a valid Phoenix expression
> outside of a phoenix::let, right?

>> I think proto should support both forms of operation. The first one can
>> be easily (more or less) achieved by simply changing proto::matches in
>> the way you demonstrated earlier, I think. I am not sure, how to do the
>> other stuff properly though.
> OK, let's back up. Let's assume for the moment that I don't have time to
> do intensive surgery on Proto sub-domains for Phoenix (true). How can we
> get you what you need?

Good question :)
I can maybe help here once the port is finished once and for all. Let's
prioritize. Too bad your day job does not involve proto :(

> My understanding of your needs: you want a way to define the Phoenix
> grammar such that (a) it's extensible, and (b) it guarantees that local
> variables are properly scoped. You have been using proto::switch_ for
> (a) and sub-domains for (b), but sub-domains don't get you all the way
> there. Have I summarized correctly?

> My recommendation at this point is to give up on (b). Don't enforce
> scoping in the grammar at this point. You can do the scope checking
> later, in the evaluator of local variables. If a local is not in scope
> by then, you'll get a horrific error. You can improve the error later
> once we decide what the proper solution looks like.

I tried that and failed miserably ... There might have another workaround, I
already have something i mind i missed earlier.

> If I have mischaracterized what you are trying to do, please clarify.

Nope, I guess this is the way it should be. Please disregard my other mail
in this thread ;)

Proto list run by eric at