The Toolkit for Online Communities
18051 Community Members, 1 member online, 1943 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : Is there a right way to deal with booleans? : One Message

Forum OpenACS Development: Response to Is there a right way to deal with booleans?

Posted by Tilmann Singer on
Both versions: <if foo nil> and <if @foo@ nil> work. There is a regsub in the templating code (tag-procs.tcl) that converts "@foo@" to "foo" if necessary before evaluating it with info exists.

The <if foo nil> variant makes more sense to those familiar to tcl, but <if @foo@ nil> is somehow more coherent with the special syntax that's used in the templates (simply everything within @'s is a variable), and certainly is easier to explain to people not familiar with tcl.

Which of those version is the 'right' one is hard to answer without docs, and besides the demo and the examples in that page: /doc/acs-templating/tagref/if.html I did not find any hints on this. I'd rather vote for the <if @foo@ nil> variant though, because of the easier-to-explain-to-non-tclers advantage.