Richard Sargent <richard.sarg...@gemtalksystems.com> writes:

> I understand your desire to utilize the existing Smalltalk mechanisms. But,
> I think the most important thing is modelling consistency.
>
> What are the behaviours you expect from Expression, SumExpression, and
> ProductExpression? Do they know their parent expression? Their children?
> Other things?

I certainly agree that this should be the main consideration, but in my
case that's done. Each Expression subclass stored its own specific
information, which for leaf nodes such as integer expressions is really
just a value. All I need is integers with added behavior.

> I think that, in general, you will benefit from fully and consistently
> modelling the parse tree.

I should have mentioned that my Expressions are not parse trees. They
are used as values in symbolic computation. They are constructed and
deconstructed all the time, which is one reason I want to eliminate
overhead, the other reason being clarity of code.

Konrad.

Reply via email to