lua-users home
lua-l archive

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



On 17-Jan-06, at 12:10 PM, D Burgess wrote:

Methinks Edgar had in mind that you would use

require"osex"   or require"os.ex"

given that you writing a C module , you can populate whicever table you
like, in this case os.

That was my thought. In fact, you can even return the os table. In fact, you can even return the os table *unmodified*. So an unextended osex package is possible :)

In other words:

local os = require "osex"

throws an error if you have an implementation which is not aware of osex.

If it doesn't, you can check for the existence of an API:

local sleep = assert(os.sleep, "This package needs sleep")