Re: Handling TRUE,FALSE,NULL,ON,OFF, etc

messju mohr <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
On Fri, Apr 09, 2004 at 11:18:17AM -0700, Andrei Zmievski wrote:
> On Thu, 08 Apr 2004, Mark Rogers wrote:
> > My point (which you snipped) is that where we don't accept |DEFAULT we *do*
> > accept TRUE/FALSE etc, then interpret them non-intuitively.
> 
> The fact that we accept invalid tokens is a bug, not a feature.
> 
> > To accept (without error) TRUE and interpret it differently from true is
> > counter-intuitive.
> 
> Of course.
> 
> > I am sure that you would not advocate dropping support for TRUE from
> > PHP and treating it as string "TRUE".
> 
> Of course not.
> 
> > Personally, while I think case sensitivity is a Good Thing in a programming
> > language (eg PHP) I'm not sure it is relevant in a templating language
> > (Smarty) - but would not argue against it. But surely we should either error
> > on TRUE/FALSE/null if they are wrong, or interpret them intuitively
> > otherwise. I cannot see an argument for interpreting them as they are
> > currently interpretted.
> 
> It should be fixed to not accept invalid (differently cased tokens).

hmm. to me this was always intuitive:
- "true", "false", "on", "off" and "null" are case-sensitive and special.
- all other \w+ are treated as strings.

please don't break stuff like {assign var=foo value="v"} or
{$var|escape:javascript} by treating invalid (=unknown) tokens as
syntax-errors.
 
> - Andrei

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.