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

boots <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
--- Andrei Zmievski <[email protected]> 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).

FWIW, I don't think it does accept such things -- except in the case of
PHP function names which, of course, are not case-sensitive. Otherwise,
Smarty is fairly much case-sensitive, AFAIK. The particular problem
here seems to be that TRUE and true are semantically different in
Smarty -- one is string, the other int/bool. I don't know if that needs
to be fixed as Smarty does not require explicit quotes when setting
strings; thus, TRUE could very well be intended as "TRUE".

Smarty has a bunch of case-sensitive issues. Further, some of those
issues are tied to PHP. Finally, Smarty does not have the same
formalisms that other languages have that would make parsing some of
these differences very worthwhile (for example, optional quotations).
Unless we are prepared to address these issues consistently, I think we
should let the status-quo remain. If we ever do breach this one, I'd
hope it would be in a major version release only.

cheers!
xo boots

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

-- 
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.