opMul
Janice Caron
caron800 at googlemail.com
Sat Mar 8 11:00:37 PST 2008
On 08/03/2008, Dave <Dave_member at pathlink.com> wrote:
> Janice, why has it been "shot down" in the past?
>
> Thanks,
Simple answer: Walter either doesn't like it or has more important
things to work on.
In fairness, this isn't the /only/ idea which has been suggested, and
I think some people did complain about the extra typing it would need.
Another suggestion was
T const f()
(the idea being that const applies to whatever is immediately to its
right). I do kinda like that one too, but Walter shot that one down,
primarily I think because it means you can't group multiple functions
together under a single "const" attribute. The "const(this)" idea
doesn't suffer from that disadvantage, but it does mean more typing,
and I think that so long as "the ranks are split", so to speak, then
there's no compelling reason for Walter to move to any particular
choice of solution.
...indeed, I don't think he even acknowledges that there's a problem.
I recall Walter saying that people will just get used to it (that's
from memory, not an exact quote - I apologise if I got that wrong), in
much the same way that we've got used to C++'s const syntax being
inconsistent.
Personally, I like "const(this)", despite the extra typing, because it
opens the door for future expansion (e.g "const(outer)" meaning "this
function will not modify outer").
Dunno if that answers the question or not. Probably not, but I tried.
More information about the Digitalmars-d
mailing list