lua-users home
lua-l archive

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


> I saw that require is now implemented... I didn't saw xpcall mentioned in
> Roberto's list of changes. Nor popen.

I forgot to mention gfind. A casual glance at the source didn't revealed
what it does, it seems to take a function as parameter...
Perhaps it executes the function on each occurence, which can be very useful
for quick string parsing.

> > F:\Languages\lua-5.0-work0\src\lib\liolib.c(579) : warning C4702:
> > unreachable code
> 
> The code is
> 
>   exit(luaL_opt_int(L, 1, EXIT_SUCCESS));
>   return 0;  /* to avoid warnings */
> 
> If we put the "return", some compilers complain. If we do not, others
> complain. Does anyone knows a solution?

Well, I saw some solutions, I like ET's one. The problem was in previous
versions of Lua and I didn't mind them, as long as I knew what was the problem.
But I understand you want a 100% warning free code...

> For the 'os' namespace, several languages use 'system'. Not that I dislike
'os', I prefer short
> namespace names.
> 
> Personally, I think splitting the Lua's tiny library up into all these
different namespaces is
> overkill.  C++'s standard library dwarfs Lua's, and it does just fine with
one namespace (std).
> The most important thing is getting the library out of the user's
namespace. I think one 'lua'
> namespace would have been more than enough, and would have kept the
namespace moniker short and
> sweet (and impossible to forget). 

The problem raised here for short namespaces (str, tab) was the ambiguity of
the names. 'io' is a quite common computer abbreviation and probably not
ambiguous, so I suppose it is OK to keep it. So is 'os', except it means bone in
French, but that's only for the annecdote :-) 'system' is good too.
If all functions goes into the same namespace, the ambiguity between the two
"remove"s (one being "delete"?) should be lifted.

> I think it's nice that io & os are separate from the others at least,
> because those are ones that many apps will want to exclude from their
> embedded Lua (for security).  I think it makes that situation clearer
> -- easier to describe, document & understand.

I like this solution, it is easy to write io = {}; os = {} to desactivate
these functions. The other ones are more secure. Although the functions are
heterogenous, one user may want to access clock or date, while the application
may want to forbid execute or remove.

Regards.

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--

GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net