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

Tips and short articles on this subject
Lua examples - coroutines, error handling, objects, etc
Passing multiple results back from a function - Lua, Python, etc
Dot, dot, dot in Lua - variable length parameter lists
What are closures in Lua?
Lua - IAQ (Infrequently Answered Questions)
Lua examples, Lua Courses
First class functions in Lua lead to powerful OO facilities
If you are learning Lua, here are some more examples
Sorting in lua - specifying your own sort routine
Short circuit evaluation (lazy operator) 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 U106
Functions.
Exercises, examples and other material relating to training module U106. 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]
Programming training is much more effective if the delegates are shown how a particular program is written, rather than just the final result ... show ...
http://www.wellho.net/mouth/1744_Lua ... urses.html  [short article]
I have presented a bespoke Lua course over the last three days ... and it has lead me to some interesting new examples which I'm sharing here. Object ...
http://www.wellho.net/mouth/2455_Lua ... s-etc.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]
In Lua, the table.sort function allows you to sort a table and by default is sorts into the order that's given back by the < operator on each of the ...
http://www.wellho.net/mouth/1697_Sor ... utine.html  [short article]
When you're writing a sort routine, passing in "a" and "b" to be compared, how do you access other data that's needed in association with a and b? If ...
http://www.wellho.net/mouth/2312_Wha ... -Lua-.html  [short article]



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

Examples from our training material
brvret   break v return
cl2d   First Closure demonstration
dress1   The problem of default global
dress2   declaring variables local to avoid global issues
dress3   Code loads at run time not compile time
ex106   excersize - functions
exrate   exchange rate example as a function
fav   Using tables and functions within them
fcv   Dynamic code loading
fsr   Flexible Function Calls
funone   Function calling and definition in Lua
funtwo   global, local and call by value
isd  An adaptive function in Lua
lazy   lazy operators / short circuit evaluation
loadthese.lua   functions to include within a test harness
lomore   variables local to a block
mj   A function to take a lot of parameters or a table
owsort   how sorting via callbacks works
rmv   returning multiple values
size.lua   sample module - exercise answer
summer   variable arguments - a function to add up numbers
symet   Symetric Functions
tabasnamed   function call via table
testharness   Loading functions from a file
vargs   Variable number of arguments
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
Defining and calling functions.
Variable scope.
Return values.
Chunks as functions.
Upvalues and Closures.
Variable Argument Lists.
Nesting and passing functions and recursion.
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.


You can Add a comment or ranking to this page

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