Function calls

dsimcha dsimcha at yahoo.com
Sun Jan 31 11:59:35 PST 2010


== Quote from Don (nospam at nospam.com)'s article
> Nick Sabalausky wrote:
> > "Pelle Månsson" <pelle.mansson at gmail.com> wrote in message
> > news:hjv9sf$1n5o$1 at digitalmars.com...
> >> On 01/29/2010 07:10 PM, Steven Schveighoffer wrote:
> >>> Note in the anecdote above, both users would have
> >>> been satisfied if you could *only* call empty without parentheses.
> >>>
> >> That's a good point. The writeln = 3; is also a good point. :)
> >>
> >> What I'm trying to defend is the ability to call non-property functions
> >> without the parens.
> >>
> >> I find this:
> >>
> >> array.stable_sort;
> >> file.detach;
> >> range.popFront;
> >>
> >> to look less noisy, clearer and just plain sexier than the respective
> >> versions with the parens.
> >
> > To me, at a glance, it looks like a series of no-ops. Like "x; y; z;". Only
> > upon closer inspection of the names does it become apperent that functions
> > are actually being called.
> >
> >
> A consequence of this discussion is that the built-in properties
> .reverse and .sort MUST be renamed. (Removal would be an acceptable form
> of renaming IMHO).

Yea, can anyone even come up with a good Devil's Advocate argument in favor of
leaving these in?  The best one I can think of is that, since arrays in D are
builtin, the basic functionality for them should also be builtin so they feel
"first-class".  This is a pretty weak argument.  The builtins made sense early on,
but now they are slow, inflexible and not substantially easier to use than the
std.algorithm functions.



More information about the Digitalmars-d mailing list