[Issue 7723] @property filter/map

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 20 18:28:56 PDT 2012


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



--- Comment #6 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-03-20 18:29:13 PDT ---
> This issue is another piece of evidence that -property is a mistake and should
> never be enforced.

I disagree. It's more an issue of what @property is for. Is it simply to try
and enable a syntax where you don't need parens if you don't feel like it, or
is it a means of providing functions that act like variables?

Normally, properties are intended as a means of replacing variables with
functions that act like the variable but do something more (e.g. enforce
invariants). But since D originally took the approach of being lax and letting
any function be called without parens if it didn't have any parameters (or be
used with = if it only had one), people got used to being lax about the their
parens with functions that had nothing to do with properties at all.

And as long as properties are intended to mimic variables rather than simply be
a means of being lax with parens, it makes no sense to use @property simply so
that you don't need to use parens.

Personally, I suspect that @property is as disputed as it is simply because D
took the lax approach initially rather than providing a way to define whether a
particular function was a property function or not. If we'd one @property
originally or done something like what C# did with get and set, it probably
would never have been an issue at all.

Regardless, I'm firmly in the camp of folks in favor of strict enforcement of
@property, and I think that this proposal goes against the concept of
properties.

-- 
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