lua-users home
lua-l archive

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


Duncan Cross <duncan.cross@gmail.com> writes:
>> (In an ideal world, probably we should have a library with those
>> functions we do not use every day (maybe with rawget, rawset,
>> getmetatable, setmetatable, collectgarbage, and some others), but I
>> do not think the change is worth the trouble. Just imagine the
>> endless discussions about what functions should go there...)
>
> I hope you reconsider this. I have been thinking for some time that
> such an "internals"/"raw" standard library, distinct from "debug"
> which should not be used in production code, would be a valuable
> step to take.

Yeah I agree.

I tend to think that a normal program should _never_ need debug (when
not debugging of course), and one should be able to delete the debug
library without causing problems.   I think sandboxes sometimes hide
the debug library entirely, so it's not just a theoretical thing.

I think Lua does need a "random system stuff" library...  A common
name for this is "sys."

Various things like rawget, etc, go in the global namespace for
historical reasons, and at least for some of them, because they're
quite often used, and more like "language features," but inevitably
there will be random stuff stuff that's occasionally useful but maybe
a little too rarely used to put in the global namespace (as of course
putting stuff in the global namespace is a little dangerous because of
the potential for conflict with user programs, and so shouldn't be
done too blithely).

-miles

-- 
Happiness, n. An agreeable sensation arising from contemplating the misery of
another.