[Issue 6442] Allow for passing values with the 'ref' keyword

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 6 23:36:34 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6442



--- Comment #14 from wfunction at hotmail.com 2011-08-06 23:36:25 PDT ---
> The _only_ things that this feature adds over using a comment are that it's slightly cleaner because the comment tokens aren't there, and
> the compiler complains if you put ref on an argument which isn't passed by ref.
> That's it.

The "*only*" things?

Really?

Let me substitute another example into your own phrase.

The "only" advantages

    /*shared(*/ int /*)*/ * p = 5;

has over

    shared(int) * p = 5;

are that it's "slightly cleaner" because the comment tokens aren't there, and
that the compiler complains if you put ref on an argument which isn't passed by
ref. "That's it."

So we should scrap away the idea of const/shared too, no?

And immutable, and shared, and 'private' members, and 'auto' fields, and
'typeof'... after all, the "only" thing they do is make things more readable
and less error-prone, right?

How is that any different from 'ref'/'out'?

--------------------------------------------------

Regarding the feature request meta-discussion, Jon:

I'm not sure myself if I'm taking it personally or not, but honestly, I'm quite
annoyed at the fact that virtually /EVERY/ suggestion I've made about D has had
this life cycle:

1. wfunction posts an idea and examples of why it might be useful.
2. Jonathan M. Davis scraps away the idea for the same reason /every/ time:
   "I can't see why it would possibly be useful."
   (i.e. any existing language with this feature must therefore be cluttered)
3. wfunction's idea goes in the trash
4. Rinse'n'repeat

Seeing this /same/ \exact\ argument throwing my ideas into the trash every
time, believe it or not, gets really annoying.

Please try to make a distinction between
  "This is a bad idea because X, Y, and Z make it a **BAD** idea."
and
  "This is a bad idea because I'm not omniscient enough to see how it could be
a good idea."
Not everyone sees everything, y'know... but you don't have to tell the world
about it every time.


(Don't forget the first half of this message, btw.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list