Properties, opIndex, and expression rewriting.

Chad J chadjoan at __spam.is.bad__gmail.com
Tue Aug 11 19:15:15 PDT 2009


Sergey Gromov wrote:
> 
> It would be nice if you made a patch.  This way we could see for
> ourselves if it worked and vote for it.
> 

I know what you mean.

I can try, but right now really isn't a good time for me to be working
on this stuff.  :(  I can maybe handle it well in a month or two when I
start looking for a job and I get my higher-priority projects finished.
   Right now I'm trying to help my family with some necessary home
improvement/repair and also release a couple (finished but not ported)
games at the moment.

> I've noticed an optimization which reduces number of calls to a getter.
> I think you shouldn't do that: you should call getter as many times as
> the expression suggests, and leave the rest to the optimizer.

It's not so much an optimization.

I removed those extra calls because it would create an asymmetry between
how many times the getter is called and how many times the setter is
called.  I suppose it could be argued that the extra setter calls should
be left in as well, and maybe that would be alright.  To be honest, I'm
not too entirely sure how to deal with that.



More information about the Digitalmars-d mailing list