lua-users home
lua-l archive

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


Sven Olsen <sven2718@gmail.com> writes:
> specification you want to require of people.  The implicit "self" created
> by ":" declarations always struck me as a minimally useful piece of sugar
> though -- why make self implicit in the parameter list, only to force
> people to type it every time they reference a member variable?  Swap "_ENV"
> for self though, and suddenly lua can go that extra 10% of the way towards
> supporting a C++ style implicit self.

I don't think the ":"-declarations are really intended to offer
"convenience" (specifying a single extra argument isn't so hard,
obviously) so much as lend a little consistency with the ":"-call
syntax, and add a little reinforcement to the notion that "in Lua,
OO-calls use :" -- something which is arguably necessary, given how
common people get confused by trying to use "." without explicitly
specifying the receiver argument...

-Miles

-- 
Education, n. That which discloses to the wise and disguises from the foolish
their lack of understanding.