Properties, opIndex, and expression rewriting.

Chad J chadjoan at __spam.is.bad__gmail.com
Wed Aug 12 19:19:22 PDT 2009


Sergey Gromov wrote:
> 
> I think it's a matter of definition.  Try to define the rewriting
> behavior, in English, as simply and unambiguous as possible: how many
> times getters and setters are called, and in which order.  I'm sure this
> will filter away many behaviors as unpredictable.  Then you say that
> compiler may optimize some calls if it can guarantee the same result and
> order of side effects.  Then you make a straight-forward implementation
> of your specification.  Then you see what you can do about
> optimizations.
> 
> Sorry if it's all obvious.  I didn't mean to lecture you, honestly.

np.  I agree.

Given the liberty of defining this, I'd like to make it both easy to
implement and unsurprising to the user.  There may be examples that make
it clear which potential definition(s) are superior.  I'm just not sure
what they are.

I'll think about it more later.



More information about the Digitalmars-d mailing list