Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Tips and short articles on this subject
Calling base class constructors
First class functions in Lua lead to powerful OO facilities
If you are learning Lua, here are some more examples
Towards Object Oriented Programming in Lua
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Lua module U107
Object Orientation - the Lua way
Exercises, examples and other material relating to training module U107. This topic is presented on public courses Learning to program in Lua, Lua Programming

Lua Programming - Learning to program in Lua and make good use of the language Our public "Lua Programming" course takes you from the basics of the language ...
http://www.wellho.net/course/ubfull.html  [course]
Learning to program in Lua - Learning to program in Lua and make good use of the language "Learning to program in Lua" takes you from the basics of computer ...
http://www.wellho.net/course/ulfull.html  [course]
In all object oriented languages, you have a facility called inheritance where you can define one type of thing ("class of object") based on another, ...
http://www.wellho.net/mouth/1819_Cal ... ctors.html  [short article]
During some courses, I write few (if any) new examples in front of my delegates, rather relying on the standard ones in the training notes (which I wrote ...
http://www.wellho.net/mouth/1699_If- ... mples.html  [short article]
I've spent a lot of the weekend working on our Lua course ... and for those of you new to this language I'll be sharing a few snippets with you here on ...
http://www.wellho.net/mouth/1692_Tow ... n-Lua.html  [short article]
"In Lua, function names are first class variables." Ok - so what does that mean? At the most direct / simplest, it means that a function can be stored ...
http://www.wellho.net/mouth/1743_Fir ... ities.html  [short article]
--[[ Simple use of a metatable to create a class ]] Box = {} local box_metatab = {} function Box.new(x,y,z) local info = {} info.x ...
http://www.wellho.net/resources/ex.php4?item=u107/meta2  [code sample]



This topic is presented on public courses Learning to program in Lua, Lua Programming

Examples from our training material
Cube.lua   Definition of a cube object
Dice.lua   Definition of a dice object - Inheritance
Sphere.lua   Definition of a sphere object
couples   Moving towards Lua objects - Metatables
cuboid   Illustrates use of a class of objects
dibdab   We can keep funtions in a table too
lottaob   Polymorphism in Lua - table of objects of different types
meta1   preparations for metatables - this is just a table
meta2   Simple use of a metatable to create a class
meta3   creating and using a table of tables("objects")
meta4   redefining operators
newCube.lua   Definition of a class in Lua
oblet   Hello Object World
obtable   Polymorphism in Lua - table of objects of different types
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
Mutable and Immutable Values.
MetaMethods and functions as members
Metatables, __index, __add and __lt
Polymorphism and inheritance
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


© WELL HOUSE CONSULTANTS LTD., 2009: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho