lua-users home
lua-l archive

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

The test/echo.lua example in the lua-5.1.3 distribution
still uses table.getn rather than #.

Test programs and demonstration programs have different
purposes, but both share the problem of how to cover
diverse aspects of Lua in a compact and economical way.
They can be the Cinderella part of the distribution.
Because Lua is usable by so many platforms, and because a program
usually needs some specific system resource actually do anything, it is
difficult to produce interesting examples that will run everywhere. The
choice of demo examples should depend on the prior experience of the
user (higher order functions, use of scope, oo, ...).

Is there a case for splitting the test/demo examples off from the
distribution tarball?

Perhaps it would be useful to have a wishlist of topics that demo
examples should address?

There are some clear topics that the current test directory touches on:

    use of combinators (factorial.lua),
    use of coroutines (fibfor.lua, sieve.lua),
    use of varargs (printf.lua), ...

Would it be helpful to have a more taxonomic approach?

Gavin Wraith (
Home page: