Function calls

Pelle Månsson pelle.mansson at gmail.com
Fri Jan 29 03:16:15 PST 2010


On 01/29/2010 05:20 AM, Steven Schveighoffer wrote:
> Look at it this way (although this is not the only way to look at it), could byLine be a field inside stdin?  It could.  You could store a copy of what byLine returns inside stdin, and people could just access it.

byLine modifies stdin. If you do this:

auto a = stdin.byLine;

You consume a line off stdin.

> There are some cases that are judgement calls and some that are obvious.  byLine is obvious.

Apparently not.

> The difference is that the *author* is making the judgement call, not the *user*.  The difference is important, because when a user complains that your property is doing things a property shouldn't, and then you realize the "property" in question isn't even a property at all, your only solution (with the non-attributed system) is to tell the user not to use it that way.  There is no way to get him to stop, or to get other users to stop.  You have lost control over the semantic meaning of your function, even though you defined it and documented it.
>
> And yes, this did actually happen to me.

Sounds like a naming issue to me. :)



More information about the Digitalmars-d mailing list