implement CondMod; include "sys.m"; sys: Sys; include "draw.m"; include "valref.m"; valref: ValRef; Val, IVal, IntVal, SVal, StringVal: import valref; include "condmod.m"; # higher-level convenience constructors Cond[ValT].range[ValT](name: string, min, max: ValT): ref Cond[ValT] for { ValT => less: fn(n: ValT, m: ValT): int; } { return ref Cond[ValT](name, ref Val[ValT](min), ref Val[ValT](max)); } Cond[ValT].equal[ValT](name: string, val: ValT): ref Cond[ValT] for { ValT => less: fn(n: ValT, m: ValT): int; } { return Cond[ValT].range(name, val, val); } Cond[ValT].zero[ValT](name: string): ref Cond[ValT] for { ValT => less: fn(n: ValT, m: ValT): int; } { return Cond[ValT].equal(name, IVal(0)); } init(nil: ref Draw->Context, argv: list of string) { sys = load Sys Sys->PATH; valref = load ValRef ValRef->PATH; # the limbo compiler chokes on this... conds := Cond.zero("debug") :: Cond.equal("product", SVal("chair")) :: Cond.range("qty", IVal(2), IVal(3)) :: nil; }