lua-users home
lua-l archive

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


Hi list,

I just added lots of documentation, including box diagrams and a
detailed example of use, to the OO mechanism that I've been using for
years, whose main part is just these these five lines of Lua code:

  Class = {
      type   = "Class",
      __call = function (class, o) return setmetatable(o, class) end,
    }
  setmetatable(Class, Class)

The code and the comments are here:

  http://angg.twu.net/LATEX/dednat6/eoo.lua.html (htmlized)
  http://angg.twu.net/LATEX/dednat6/eoo.lua      (original)

I guess that most people here will find it almost offensibly simple
but I have hope that some people will find the box diagrams and the
reduction diagrams in its documentation inspiring... maybe even to the
point of creating box diagrams for some of the OOs here:

  http://lua-users.org/wiki/ObjectOrientedProgramming
  http://lua-users.org/wiki/ObjectOrientationTutorial
  http://www.lua.org/pil/16.html

Cheers =),
  Eduardo Ochs
  http://angg.twu.net/dednat6.html