Re: weird macro params issue

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Thursday, May 22, 2008, 3:10:27 PM, Tim Diggins wrote:

> On 22 May 2008, at 13:51, Attila Szegedi wrote:
>
>>> <#macro foo bar baz!>
>>>   <#if !baz??>
>>>       <#local baz = bar />
>>>   </#if>
>>> </#macro>
>>>
>>> If this was possible, I'd vote for not supporting the "weird  
>>> defaults"
>>> at all.
>>
>> "Weird defaults" - I like the name :-) Well, consider how the "weird
>> defaults" would cut down the character count in your above example
>> considerably; that's basically how I think of them - a syntactic
>> replacement for a bunch <#if> statements.
>
>
>
> I hope you're not arguing that character count is more important than
> understandability / readability / learnability.

I would think that if someone understands this:

  <#macro foo x y=1>

Then he also automatically understands this:

  <#macro foo x y=x>

Of course if you are "overly educated" then you will start wondering
about evaluation orders and such, but most people will just blindly
conclude that y defaults to the value of x, and that's it.
  
> I would guess that many FTL users are using FTL as one of many  
> languages and 'return' to FTL after varying sized gaps. That returning
> needs to be pleasant, or FTL won't survive.

(And I'm afraid it too often won't... but that's unrelated.)

> but I'm not arguing that strongly against this feature, if the logic  
> can be made clear and understandable. (Maybe it's just that I 'return'
> to FTL from python (and Java), that I have such a problem with this one)
>
> -- Tim

-- 
Best regards,
 Daniel Dekany


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.