lua-users home
lua-l archive

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


On Mon, Aug 18, 2014 at 3:27 PM, Andrew Starks <andrew.starks@trms.com> wrote:
> The. Most. Important. Feature of PL was the documentation. It was relatively
> complete by FOSS standards and  the narrative portions provided a good dose
> of the thinking behind the design.

Now I'm happy ;)  Exactly what the intention was.  Always room for
improvement, of course.

> 1: the object system in PL could benefit from some breaking changes.

I'd like to see how far we could push changes that would not break the
basic contracts of this object system; (1) objects have a shared
metatable containing their methods  (2) this metatable is what we mean
by the object's "class" (3) this "class" itself has a metatable which
is callable and makes it usable as a constructor  (4) inheritance
happens through copying inherited methods into the class ("fat
metatable").   But perhaps that's mixing interface with implementation
too much - I'd say that (1) and (2) are the crucial ones.

> 2: perhaps object systems are best left hand made and ad-hoc. At most, pl
> might provide some common utility templates for objects

They're useful in a lazy way, if the problem matches the OOP pattern.
Of course in Lua OOP should never be religion and often first-class
functions are the cleanest solution.

And pretty.write isn't so very pretty - we can learn from Paul K's Serpent...

steve d.