|
Proto : |
Subject: Re: [proto] Externalizing grammar pattern matching
From: Eric Niebler (eric_at_[hidden])
Date: 2010-11-23 11:20:32
On 11/23/2010 10:19 AM, Joel Falcou wrote:
> So, question is: is there a way to have an extensible list of
> when<pattern,rule> that can be extended "from the outside", something
> like a proto::switch_ but with patterns instead of tag ?
No. The best you can do is document how to define a new Proto algorithm
from an old one:
struct Old : proto::or_< ... > {};
struct New : proto::or_< my_stuff, Old > {};
Now everywhere in your library that you have the Old algorithm
hard-coded, you need to make it a template parameter so that your stuff
can be used with an extended algorithm.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Proto list run by eric at boostpro.com