Re: How to refer to sibling variable value ?

Daniel Dekany <[email protected]> Wed, 11 Nov 2015 09:27:10 +0100
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
There is no way, other than using an external variable. (I haven't
seen such feature in any other language either.)

BTW, this mailing list has been retired. Please use
[email protected] instead. To subscribe, just write
an empty mail to [email protected]
(there's no separate user list anymore). Or, use Stack Overflow with
tag "freemarker".

-- 
Thanks,
 Daniel Dekany


Wednesday, November 11, 2015, 5:45:09 AM, Albert Kam wrote:

> I couldnt access sibling value from within nested hash item definition.
>
> Non-working example:
>
> <#assign parent={
>     'sibling1': 'sibling 1',
>     'sibling2': sibling1 + ' sibling'
}>>
>
> or
>
> <#assign parent={
>     'sibling1': 'sibling 1',
>     'sibling2': parent.sibling1 + ' sibling'
}>>
>
> I had to reserve to a variable outside the hash definition to work:
> <#assign val='sibling 1'
>     parent={
>         'sibling1': val,
>         'sibling2': val + ' sibling'
>     }
>>
>
> Is there a way to refer to sibling value from a hash item definition ?
>


------------------------------------------------------------------------------