on 11/26/01 9:13 AM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:
> "Geir Magnusson Jr." <[EMAIL PROTECTED]> writes:
>
>> Hm. This is kinda cool. I can see where we have to change the code to
>> support this - not bad.... Then the proxy will pass in the default values
>> on invocation if they aren't in the actual VM invocation.
>>
>> The only downside is that this could be damn confusing for people to read if
>> they aren't familiar with the idea.
>
> I've used scripting languages with APIs like this before. It would be
> a really bad idea to add such extraneous cruft to a templating tool
> like Velocity.
+1
You can achieve the same effect by having your $var return a default value
instead of null.
#macro (foo $bar)
This is: $bar
#end
#foo ($var.getString("ack"))
public class Var
{
public String getString(String in)
{
try to get data
if (null)
return "default";
}
}
I am strongly -1 on adding that 'enhancement' idea to the #macro
functionality. Now I just get to wait for all of you to flame me for being
-1 on yet another thing. Sigh.
-jon
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>