Revised RFC on range design for D2
Sergey Gromov
snake.scaly at gmail.com
Sun Sep 28 04:46:29 PDT 2008
Sat, 27 Sep 2008 23:08:43 -0700,
Chris R. Miller wrote:
> Andrei Alexandrescu wrote:
> > I think we all agree that there are some annoyances related to the whole
> > property business, among which the main one is:
> >
> > writeln = 4;
> >
> > That is quite indefensible :o|. I consider the others rather minor, but
> > that's just a personal opinion.
> >
> > How about this. Maybe if we attacked this annoyance in particular, that
> > would be a large bang for the buck without a landslide change in the
> > compiler. We only need some way to inform the compiler, "yes, it's ok to
> > call a.b(c) as a.b = c". Ideas?
>
> Just trying to think of something that could be easily parsed...
>
> void foo(char t)!={ /*do something with t*/}
> void bar(char t) { /*do something with t*/}
>
> void main() {
> foo('t'); // okay
> foo='t'; // not okay because of the "!="
> bar('t'); // okay
> bar='t'; // okay
> }
>
> My thinking is that it doesn't break existing code. One could change
> the order to precede the argument list, but I don't like that as much
> because it becomes ambiguous when used in conjunction with templates.
I cannot see how trickery with an existing syntax is less a feature than
a new keyword.
More information about the Digitalmars-d-announce
mailing list