Difference between revisions of "Slimport"
m (→Description) |
m (→Description) |
||
(One intermediate revision by the same user not shown) | |||
Line 15: | Line 15: | ||
Imports all names (keys) defined in the simplelib interface into the global environment [[_G]]. Use is strongly discouraged as the library will no longer be able to catch errors in usage stemming from calling undefined, misspelled, or overwritten names. | Imports all names (keys) defined in the simplelib interface into the global environment [[_G]]. Use is strongly discouraged as the library will no longer be able to catch errors in usage stemming from calling undefined, misspelled, or overwritten names. | ||
− | Note that in version 0.06 forward in the library, actual interface table members can be specified in any case desired, and partially specified names are selected by a matching metamethod, e.g. sl. | + | Note that in version 0.06 forward in the library, actual interface table members can be specified in any case desired, and partially specified names are selected by a matching metamethod, e.g. sl.sLiM() matches sl.slimport() and sl.FILE() matches sl.file(). This functionality cannot be duplicated in the [[_G]] environment; another reason avoid importing library names. |
Valid values for the string argument style include any/all of the following case specifiers for the imported names: 'lower' (default naming convention), 'upper', and or 'camel' (for CamelCase). | Valid values for the string argument style include any/all of the following case specifiers for the imported names: 'lower' (default naming convention), 'upper', and or 'camel' (for CamelCase). |
Latest revision as of 15:41, 30 November 2010
Calling Convention
Call
sl.slimport(style)
Args
style is a string, valid values include any combination of 'lower', 'upper', 'camel'
Results
none
Usage Example
local sl = dofile(getinstalldir()..'/lib/simplelib.lua') sl.slimport('camel')
Description
Imports all names (keys) defined in the simplelib interface into the global environment _G. Use is strongly discouraged as the library will no longer be able to catch errors in usage stemming from calling undefined, misspelled, or overwritten names.
Note that in version 0.06 forward in the library, actual interface table members can be specified in any case desired, and partially specified names are selected by a matching metamethod, e.g. sl.sLiM() matches sl.slimport() and sl.FILE() matches sl.file(). This functionality cannot be duplicated in the _G environment; another reason avoid importing library names.
Valid values for the string argument style include any/all of the following case specifiers for the imported names: 'lower' (default naming convention), 'upper', and or 'camel' (for CamelCase).