read-only access

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 2 19:15:24 PDT 2010


On Tuesday 02 November 2010 15:02:04 Jesse Phillips wrote:
> Steven Schveighoffer Wrote:
> > It does not say that functions should be callable without parentheses,
> > because that mis-feature is deprecated.  Essentially, to someone who is
> > new to D, there is no need to mention the historical features of D.  It
> > does say that you need to put @property on functions to make them into
> > properties.  At least the copy I reviewed said that (I don't have a final
> > copy).
> > 
> > -Steve
> 
> I think part of my distrust is I recall getting an error message to the
> effect of:
> 
> Error: cannot call property function using ()
> 
> But I'm not getting any such error now, so I don't know what I was fixing.

Properties are discussed on page 156 of TDPL. It specifically states that 
property functions _must_ be called without parentheses but says nothing about 
whether you can call other functions without them - presumably because it's 
assumed that the way to call a function is with parens and that being able to 
call non-property functions without parens is not supposed to be in the language 
anymore, so there's no point in mentioning it.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list