[Templates] documentation inconsistency ("and" vs "&&")
Andy Wardley
abw@wardley.org
Fri, 20 Apr 2007 14:35:35 +0100
Ask Bjørn Hansen wrote:
> The directives documentition [...] says:
>
> "Note that 'and', 'or' and 'not' are also provided as aliases for '&&',
> '||' and '!', respectively.
>
> Conditions may be arbitrarily complex and are evaluated with the same
> precedence as in Perl. Parenthesis may be used to explicitly determine
> evaluation order."
I've clarified it like so:
The C<and>, C<or> and C<not> operator are provided as aliases for
C<&&>, C<||> and C<!>, respectively. Unlike Perl, which treats
C<and>, C<or> and C<not> as separate, lower-precedence versions of the
other operators, the Template Toolkit performs a straightforward
substitution of C<and> for C<&&>, and so on. That means that C<and>,
C<or> and C<not> have the same operator precedence as C<&&>, C<||> and
C<!>.
Cheers
A