Re: [FreeMarker-user] FW: crud screens and null.
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
|
From: Daniel D. <dd...@fr...> - 2006-05-09 14:43:52
|
Tuesday, May 9, 2006, 4:11:39 PM, Joe Hudson wrote:
>> -----Original Message-----
>> From: fre...@li... [mailto:freemarker-user-
>> ad...@li...] On Behalf Of Daniel Dekany
>> Sent: Tuesday, May 09, 2006 9:58 AM
>> To: Payne, Matthew
>> Cc: fre...@li...
>> Subject: Re: [FreeMarker-user] FW: crud screens and null.
>>
>> Tuesday, May 9, 2006, 3:16:12 PM, Payne, Matthew wrote:
>>
>> > +1
>> >
>> > Support the !.
>>
>> I disagree. The ! of Velocity doesn't let you specify the default
>> value, so what should the template language do with the "suppressed"
>> null then?
>
> I disagre. I think that if you evaluated all the FreeMarker templates out
> there you would see a lot of ${something?if_exists} or
> ${something?default("")}. The easy syntax isn't meant to address
> ${something?default("something else")}.
If you are that sure about it, then I don't know... Give me some
concrete examples! I have seen "" as the default value seldom... where
is that useful, other than for some primitive Web form handling?
Also, unless you use ?if_exists logic *extremely* often, isn't it
foo!'' and foo![] or foo!{} better than foo! is? At least it's clearly
visible what the default value is. I mean, you spare two keystrokes by
allowing just !, but is that worth the price that your template will
be less explicit?
> I like Daniel's idea of shorter syntax for ${something?default("something
> else")} but I certainly think that it doesn't mean that $!{something} isn't
> useful.
>
> Joe
--
Best regards,
Daniel Dekany
|