lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, May 1, 2014 at 3:34 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> The idea is from Ada.
> That explains a lot. In fact, it explains everything.

I don't know the girl in question, but I do know her mother Pascal,
and cousin Eiffel.  It's considered a feature that functions/methods
of no arguments require no parentheses.  Betrand Meyer argues that it
allows o.f to be implemented as a field or a function, without the
implementer being constrained or the user needing to know[1]

But in a language with first-class function values it makes no sense.
o.f is the value of the field 'f' of 'o';  if it is a function, then
we have to apply an explicit call operator to it.  With Thomas'
proposal, this remains true; but the odd construction 'o:f' on its own
has an implicit call operator.

I think this inconsistency would be hard to explain to anyone
encountering it for the first time.

[1] .  A refinement of this idea is that of _properties_, like in the
Borland dialect of Object Pascal, (possibly inspired by the VB
events/properties model) and then carried by its chief architect over
to C#.