Re: weird macro params issue

Attila Szegedi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
On 2008.05.22., at 14:44, Felix Gnass wrote:

> My preferred solution would be, if it was possible to mark  
> parameters as
> optional. This way there would be no need to introduce a new keyword
> (like "null").
>
> <#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.

Attila.


-------------------------------------------------------------------------
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.