condition(property) wrapper for the _condition function.
See $FG_ROOT/Docs/README.condition
This commit is contained in:
parent
a6496bbf0b
commit
d1c4bcea85
1 changed files with 12 additions and 0 deletions
|
@ -76,6 +76,18 @@ setlistener = func {
|
|||
}
|
||||
|
||||
|
||||
##
|
||||
# Convenience wrapper for the _condition function. Takes a
|
||||
# property path string or props.Node object as argument,
|
||||
# evaluates the property as <condition> and returns 1 or 0
|
||||
# for true/false (see $FG_ROOT/Docs/README.condition).
|
||||
#
|
||||
condition = func(prop) {
|
||||
if(isa(prop, props.Node)) { prop = prop._g; }
|
||||
elsif(typeof(prop) != "scalar") { return; }
|
||||
return _condition(prop);
|
||||
}
|
||||
|
||||
##
|
||||
# Returns true if the symbol name is defined in the caller, or the
|
||||
# caller's lexical namespace. (i.e. defined("varname") tells you if
|
||||
|
|
Loading…
Reference in a new issue