48 hour game jam

Philippe Sigaud philippe.sigaud at gmail.com
Tue Oct 16 13:44:11 PDT 2012


On Mon, Oct 15, 2012 at 8:00 PM, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:

> Better yet, if you designed the isExprType template correctly, you can
> even have a derived class of an expression node that stores a value, and
> specifies parsing functions that computes the value on the expression
> on-the-fly. So instantiating parseExpr with the base class gives you an
> expression tree, and instantiating it with the derived class computes
> the value of the expression at parse-time. In the latter case, even the
> return type is the correct derived class so you don't even need to
> down-cast a base class reference to get at the value. (I actually have
> code that does this. You cannot imagine the sense of power when code
> like this can be written _cleanly_, without bending over backwards and
> running a 100-meter dash with your left leg tied to your neck.)

Is this code available somewhere?


More information about the Digitalmars-d mailing list