"Geir Magnusson Jr." wrote:
>
> "Daniel L. Rall" wrote:
> >
> > Jason van Zyl wrote:
> >
> > SNIP
> >
> > > So if you had the following line:
> > >
> > > <input type="text" name="email" value="$!email">
> > >
> > > and $email had not yet been defined then the
> > > output would look like this:
> > >
> > > <input type="text" name="email" value="">
> > >
> > > I tried implementing it this feature and it
> > > works fine. Is it something that should be
> > > added?
> >
> > I like the idea, but find the use of '!' a little confusing. Of course,
> > I just woke up... ;)
>
> True. Hoping not to wade back into the format-layer debate I watched go
> by, nor rekindle the multiple-syntax idea, how about a preprocessor-like
> facility so we can build things like this w/o making the language
> bigger. For example :
>
> <input type="text" name="email" value="#isNull($email, "")">
>
> where
>
> isNull(x,y) := #if (x) { x } #else { y }
>
> A basic library of these will solve requests for things like $!var, and
> people can extend it themselves.
>
> And with caching, there should be no performance penalty.
>
> I would volunteer to work on this, if it were deemed wanted.
An interesting idea, but my gut says -1 on macros in Velocity. Consider
C vs. Java and our intended audience of web designers. I wouldn't mind
having a shorthand for this particular thing, just don't know if the one
suggested was the clearest.
--
Daniel Rall <[EMAIL PROTECTED]>