On Sun, 2005-01-09 at 23:43 +0100, Incze Lajos wrote:
> On Sun, Jan 09, 2005 at 11:51:44PM +0900, Shinobu Kawai wrote:
> > Hi guys,
> > 
> > > ah, i see what you're saying.  hmm.  perhaps it would help to change
> > > perspective.  rather than see this as a true/false type evaluation,
> > > see it as a render/no-render situation.  then the template engine is
> > > only responding to its own behavior rather than evaluating an external
> > > condition.  in other words, it says "i didn't render this, so i should
> > > render this instead" (apologies for the anthropomorphizing).
> > 
> > I'm +1 for Nathan's suggestion.  It's simple, easy-to-understand, and
> > I don't see any backwards-compatibility issues on it (not that I saw
> > any in the first place).
> > 
> > So the conditions for the #else part to be rendered would be one of:
> > - there were no elements to render
> > - the introspector failed to get an iterator
> > Am I getting this right?
> > 
> 
> Seems to be all right, but in this case it would be nice to reword
> the guides in this sense. (#if #elseif #else -  #foreach #else, as
> a render/no-render decision point, which is intuitively well known,
> but the usual semantics of IF, ELSE et al. supresses that sense.)

The render/no-render paradigm has nothing to do with #if #elseif #else.

But your remark is somewhat interesting, still one could consider the
exact opposite, hence using #foreach #elseif. Only mentionning it,
certainly not very k.i.s.s.able (hum) and easily reachable with an #if
inside the #else block of the #foreach, but at least not disturbing and
semantically consistent. Well, just some sort of lowcost inoffensive
hack for developers and/or second importance debate for purists about
mixing #if and #foreach paradigms, but anyway I digress. What about
having a #schmoo directive that prints a fortune ?

And of course you're right, the day guides will speak of #foreach #else,
the render/no-render terminology should be explicitely used.

Claude




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to