on 9/24/2000 1:16 PM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:
> 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.
There is a difference in my mind between directives (#) and variables ($).
For simplicity, I really want to keep the number of directives to as few as
possible because I relate directives to functions. I would however agree
that we should provide a number of tools to go into the context (ie: like
WM's ContextTools).
The more that I think about it, the more I'm -1 on $!foo. The reason is that
it makes us start to look like Perl syntax where you have all sorts of
"modifiers" on variables and that gets confusing for people very quickly.
So, to take your proposal one step further:
<input type="text" name="email" value="$tool.Value($email, "")">
That seems perfectly acceptable and is a valid way right now to solve the
problem without any core language changes.
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/