On Sun, 24 Sep 2000, Jon Stevens wrote:
> 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).
A library of tools would be great. Could we move some of the
utilities that have been created in turbine and move them
into velocity?
> 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.
I rather like the shorthand. I think people would get used to some
form of shorthand. We could choose a better notation.
Maybe we could just have a configuration option for undefined
values. If it's undefined then it come's out as an empty
string, or whatever you want.
> 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.
Again, the $!foo reference could be valid but if you prefer
to use $tool.Value($email, "") then you can. I actually think most people
would prefer to type:
<input type="text" name="email" value="$!foo">
over
<input type="text" name="email" value="$tool.Value($email, "")">
I agree that in the reference $!foo, the notation doesn't really
tell us a lot, but people like a little bit of jargon :-). And
they don't have to use it if they don't want to.
It only took a line in the grammar, and an extra if
statement in the node responsible for resolving references.
It doesn't clutter the grammar by any means. Maybe there is a better
notation?
jvz.
--
Jason van Zyl
[EMAIL PROTECTED]