lua-users home
lua-l archive

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


"Edgar Toernig" <froese@gmx.de> writes:

> I have to defend my unified methods ;-)

I understand :-)

> Jay Carlson wrote:
> >
> > For instance, unified methods significantly changes the semantics
> > of ":" away from being syntactic sugar,
>
> The syntactic sugar becomes:
>
>     x:y(a)
>
>   is the same as:
>
>     methods(x).y(x,a)
>
> To keep compatibility you may choose another operator for this.
> I.e. '::' or '->' but IMHO the ':' is the "method" operator and
> should access the method table.
>
> > and loses some of the "everything's a table" flavor of current Lua
> > object programming.
>
> HUH???  Why?  Everything still is a table and the tag methods become
> table driven.  Maybe you misunderstood something?

It feels like the difference between LISP1/Scheme and LISP2/CL.  There are
now two namespaces you have to think about; one for use as data, and one for
use for function calls.  Moving method invocation off ":" would at least
make that syntactically apparent to current users.

Look, I haven't made up my mind yet about unified methods.  They offer a lot
of nice features that seem useful in day-to-day programming.  But it's a
significant enough change that I need to think about it, a lot---because it
*is* an interesting and thoughtful proposal.  In comparison,
ExtendingForAndNext is a very localized language change, and one that seems
like an oversight from the original language design.

Taste in language constructs is very personal.... :-)

Jay