Ternary operator?
"Newman, John W" <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <EE3D0D387D01C8498EC1CED489DEAB253815829E3C@msxmbxnsprd01.acct.upmchs.net> |
Hi,
Just wondering what, if any, plans to support or existing support we have for the useful Boolean ? expr : expr construct...
Currently I'm stuck with this 5 liner
[#if pageNumber - numPagesToShow > 0]
[#assign firstPage = pageNumber - numPagesToShow /]
[#else]
[#assign firstPage = 1 /]
[/#if]
Could be written as
[#assign firstPage = pageNumber - numPagesToShow > 0 ? pageNumber - numPagesToShow : 1 /]
Any plans to support this type of thing in the future? Can I achieve this using something else now? No big deal, just a bit more terse which is generally good.
And the ++ and -- operators would be nice if supported also.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user