Re: weird macro params issue

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Friday, May 23, 2008, 2:12:11 PM, Daniel Dekany wrote:

> Friday, May 23, 2008, 1:51:13 PM, Denis wrote:
>
>> Resend
>
> (Like this? Get a decent mail client... :) Oh, sh*t, I have just
> realized you have an iPhone! Please, don't hit me! :-> )
>
>>>>> Some people will protest, that are used to defaults as mere constant
>>>>> values,
>>>>
>>>> Puzzling opinion... why would anyone *protest* about it? Yeah, I can
>>>> see as someone finds <#macro chapter title linkLabel=title> and
>>>> "WHAT??? This Is Outrageous!!! Defaults were always constants! This  
>>>> is
>>>> how our fathers did it, and the fathers of our fathers!". ;)
>>>
>>> Lol
>>> They will protest because in Python and others, the other arguments  
>>> are not in the current scope. Similarly when you do
>>>
>>> VAR x = x
>>>
>>> It uses x in the enclosing scope, it is not a recursive definition.
>
> That stands for default argument thing of FTL as well. You can say
> <#macro foo x=x> after all. The scope of the default value expression
> is the whole parameter list.
>
>>> Btw how does the multipass deal with
>>>
>>> <#macro foo=bar bar=foo>
>>> ?
> [snip]
>
> It fails with error. (Even if you don't forget the macro name... ;) )

Or not. See Attila's answer...

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