On 5/31/2010 3:39 AM, Joel de Guzman wrote:
On 5/31/2010 11:35 AM, Eric Niebler wrote:
On 5/30/2010 10:50 PM, alfC wrote: <snip>
Of course the patterns do not need to be necessarily *simple* in the future, once we master Phoenix we can go beyond to write transformation rules for expression, in order to do that I must gain complete access to the internal subexpressions and subexpression types.
In that case, I think your best bet is to build your own DSEL using Proto. Proto will let you define placeholders and will build expressions for you. It will *also* give you the tools to access, analyze and transform subexpressions in the ways you describe. In essence, you'll need to implement your own mini-Phoenix. That's the bad news.
The good news is: in the (near!) future, Phoenix will be built on top of Proto so that you'll be able to use Proto to access, analyze and transform Phoenix expressions. <snip>
Indeed very timely. See also: http://tinyurl.com/37mguzo "phoenix domain language (to write mathematical formulas)"
(Cc'ing the author)
This is not the first time Phoenix has been used this way. Yet one of the reasons why I insist on a simple extension interface. I think we're on the right track, Eric.
The "phoenix domain language" thread argues for a simple extension interface, but that this thread argues for powerful expression introspection and transformation facilities: two separate things, both of which will be nicely addressed by our current working design. Yes, we're on the right track. Finally. -- Eric Niebler BoostPro Computing http://www.boostpro.com