lua-users home
lua-l archive

Re[2]: [ANNOUNCE] bare-bones loadlib

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


ET> Just my 2 cent:
ET> - The API should be like that of loadfile: accept a string and return
ET> a function. loadlib itself should only load the lib, not execute it.
I prefer get table with library contents rather than usless function.
For example:
strlib = loadlibrary("strlib")
m = strlib.format("%02d", 13)
--...
Or
tklua, message = loadlibrary("tklua")
assert(tklua, format("library tklua loading fail with error: %s", message))
label = tklua.tklabel{}
using(tklua)
name = tkentry{}
--...
This may resolve namespace collisions.
--Denq

AltStyle によって変換されたページ (->オリジナル) /