Re: Is there a more elegant way to d o null checks?

"Jan Haderka" <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
When I rewrote my tag files as macros, I produced a lot of bloated template
code like so:

[#if (template?? && template.scripts?? && template.scripts.inline?? &&
template.scripts.inline.head??)]do something[/#if]

Is there a more elegant way to check if the head value is empty? I have

I'm not an expert, but would not something like:

[#if (template.scripts.inline.head)??]do something[/#if]

do?

Jan

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
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.