lua-users home
lua-l archive

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


On Sun, 2006-01-08 at 23:27 +0000, David Given wrote:
I can see where you're coming from, but there's another factor to consider,
which is that of familiarity. I'm a long-time Unix developer. I *know* what
setenv(), putenv(), unlink(), stat() etc do. When I use those functions from
Lua, I'd very much prefer Lua's interface to be as thin as possible so that I
don't have to learn a whole new API style for functionality that I've been
using for years.

I totally agree with this.  I guarantee we will reach a much greater audience this way, as the interface would be already ubiquitous.  And like I keep saying, with a thin API it is easy for the community to abstract on top of the standard.  If you want a directory iterator, you can use the thin API to create this functionality yourself, and then release it in a non-standard library.

And I already proposed "a simple means of discovering whether the given interface exists" (Rici).  A function is defined if and only if it is implemented.  I think this is as "Lua-like" as you can get:

if osex.setenv then osex.setenv ("key", "value") end;

osex.setenv () --will throw error if setenv isn't implemented