lua-users home
lua-l archive

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

it was nice to get much attention to the naming issue.

in fact, i've already started work on 'sdl_wrap.lua' (part of gluax 2.18) that uses the SDL.* notation. However, it does this by redirecting the original (C++) module's function, and enhancing some of them. For compatibility reasons, i keep the 'old stuff' as they are.

In gluax, you can either say USES 'sdl' (for the old interface) or USES 'sdl_new' (for the new one).

Seems like that wrapper should be brought to LuaCheia, too.


p.s. it is quite possible to enforce not using global namespace. i've done that, with modules that themselves think they're putting stuff to global. Eventually (for apps) it becomes something_else.*

Peter Loveday kirjoittaa tiistaina, 5. elokuuta 2003, kello 20:17:

My view is that modules should not be allowed to place things in the global
namespace.  Obviously we can't enfore it, but it can be strongly

I think SDL.LoadBMP() is far more consistant with anything else in LuaCheia. It is a lot more obvoius to a user that a given module has functions within a given table, and has the added bonus that dumping the contents of that
table gives you a quick list of functions available in the module.

I am not certain that SDL will be a major part of an app that uses it in scripting... For example, we don't use SDL in our app at all, and 99% of scripts will not. If a given script does then thats fine, but that is a per-script thing, and to some degree per-use developing the script for our
app.  I can see the similarity to C code being appealing; but we're not
trying to reproduce C, we're trying to make a more consistant manageable
scripting system.

So, in summary, I would definitely vote for SDL.LoadBMP() etc :)

Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software

----- Original Message -----
From: "Asko Kauppi" <>
To: "Lua list" <>
Sent: Tuesday, August 05, 2003 1:11 PM
Subject: SDL package (namespace problem)

I've thought of the SDL namespace problem, and (personally) of the
opinion that it should be in the global namespace. That is,
SDL_LoadBMP() etc.

- that's how C (sample) code is written
- if you code for SDL, it's not just a library (among the others) but
a main part of your app

Opinions are welcome.

John Belmonte kirjoittaa tiistaina, 5. elokuuta 2003, kello 18:09:

This is looking good and builds without any fuss.  I wonder if a few
points could be improved:

* support for use of external Lua library. Do you use a stock Lua
library compile?  This will be significant when packaging for Debian,
etc.  Also since IUP also contains the Lua source, and you want to
make IUP a module, at least one of you will have to concede...

    * rewriting wrapper names (for example, SDL.LoadBMP instead of


Thatcher Ulrich wrote:
luacheia is a full-featured, modular Lua distribution.  The project
homepage is at

http:// if   l .o  /