1
0
Fork 0

condition(property) wrapper for the _condition function.

See $FG_ROOT/Docs/README.condition
This commit is contained in:
mfranz 2007-03-17 15:59:39 +00:00
parent a6496bbf0b
commit d1c4bcea85

View file

@ -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