freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ondra Žižka (JIRA) <j...@apache.org>
Subject [jira] [Commented] (FREEMARKER-21) Reference to the object in condition - avoid repeating the same in #if and ${...}
Date Wed, 20 Apr 2016 20:16:25 GMT

    [ https://issues.apache.org/jira/browse/FREEMARKER-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250621#comment-15250621
] 

Ondra Žižka commented on FREEMARKER-21:
---------------------------------------

Even better :)

> Reference to the object in condition - avoid repeating the same in #if and ${...}
> ---------------------------------------------------------------------------------
>
>                 Key: FREEMARKER-21
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-21
>             Project: Apache Freemarker
>          Issue Type: New Feature
>          Components: engine
>            Reporter: Ondra Žižka
>             Fix For: 2.3.23
>
>
> Repeating stuff is annoying, especially in programming.
> Therefore this is annoying:
> {code}
> <#if someVariable.someMethod.someProperty??>
> <div>${someVariable.someMethod.someProperty}</div>
> </#if>
> {code}
> This would be better:
> {code}
> <#if someVariable.someMethod.someProperty?? as value>
> <div>${value}</div>
> </#if>
> {code}
> Not talking about the fact that it could only be evaluated once.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message