Difference between revisions of "Non"
From OpenEUO
m (→See Also) |
m (→Usage Example) |
||
Line 18: | Line 18: | ||
print(d) | print(d) | ||
− | --> | + | --> false |
− | + | true | |
− | + | true | |
− | + | false | |
== Description == | == Description == |
Revision as of 16:00, 2 November 2010
Calling Convention
Call
local r[,...] = sl.non([...])
Args
a1...aN are of any type
Results
r1...rN are boolean
Usage Example
local sl = dofile(getinstalldir()..'/lib/simplelib.lua') non = sl.non null = sl.null local a,b,c,d = non(false,nil,null,0) print(a) print(b) print(c) print(d)
--> false true true false
Description
Tests each supplied argument as to whether it is nil or null. If so, then non returns true for that value, otherwise false. non returns the same number of values as the number of arguments it accepted.
Upon Error
If non receives no arguments, then it returns a single nil value.