on 9/24/2000 1:04 PM, "Jason van Zyl" <[EMAIL PROTECTED]> wrote:
> 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?
Yes, that would be the plan.
>> 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.
Right, I agree that the shorthand chosen is fine $!. What I'm worried about
is that this will just be the start of the requests for more shorthand
things.
>> 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, "")">
Probably, but the problem with $!foo is that you can't have a default option
specified. Think of it this way...you code up your entire site with $!foo
and then you realize that you need to specify a default option for
everything...what do you do?
I think that the different notation is simply using a context tool for it.
:-)
-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/