Index: openacs-4/packages/acs-templating/tcl/tag-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-procs.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-templating/tcl/tag-procs.tcl 17 Feb 2002 13:53:31 -0000 1.5 +++ openacs-4/packages/acs-templating/tcl/tag-procs.tcl 9 Mar 2002 22:46:44 -0000 1.5.2.1 @@ -188,8 +188,9 @@ } default { - # abort evaluation - error "Invalid operator $op in IF tag" + # treat as a shortcut for + append condition "\[template::util::is_true $arg1\]" + set next [expr $i - 1] } } Index: openacs-4/packages/acs-templating/www/doc/demo/if.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/if.adp,v diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- openacs-4/packages/acs-templating/www/doc/demo/if.adp 13 Mar 2001 22:59:27 -0000 1.1.1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/if.adp 9 Mar 2002 22:46:44 -0000 1.1.1.1.2.1 @@ -4,7 +4,11 @@

The value of x is @x@
The value of y is @y@
- The value of n is @n@

+ The value of n is @n@
+ The value of bool_t_p is @bool_t_p@
+ The value of bool_1_p is @bool_1_p@
+ The value of bool_f_p is @bool_f_p@
+ The value of bool_0_p is @bool_0_p@

@@ -14,61 +18,107 @@ - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
eqif x eq 5if \@x\@ eq 5 X is 5X is not 5
eqif x eq 6if \@x\@ eq 6 X is 6X is not 6
eqif n eq "Fred's Flute"if \@n\@ eq "Fred's Flute" N is "Fred's Flute" N is not "Fred's Flute"
eqif n eq "Fred"if \@n\@ eq "Fred" N is "Fred" N is not "Fred"
definedif x definedif \@x\@ defined x is defined x is undefined
nilif x nilif \@x\@ nil x is nil x is nonnil
definedif z definedif \@z\@ defined z is defined z is undefined
nilif z nilif \@z\@ nil z is nil z is nonnil
definedif w definedif \@w\@ defined w is defined w is undefined
nilif w nilif \@w\@ nil w is nil w is nonnil
nilif \@w\@ nilw is nil + w is nonnil
trueif \@bool_t_p\@ trueok + not ok
trueif \@bool_1_p\@ trueok + not ok
true shortif \@bool_t_p\@ok + not ok
true shortif \@bool_1_p\@ok + not ok
falseif \@bool_f_p\@ falseok + not ok
falseif \@bool_0_p\@ falseok + not ok
+ + + Index: openacs-4/packages/acs-templating/www/doc/demo/if.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/if.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- openacs-4/packages/acs-templating/www/doc/demo/if.tcl 13 Mar 2001 22:59:27 -0000 1.1.1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/if.tcl 9 Mar 2002 22:46:44 -0000 1.1.1.1.2.1 @@ -11,3 +11,10 @@ set n "Fred's Flute" set z "" + + +set bool_t_p t +set bool_1_p 1 + +set bool_f_p f +set bool_0_p 0