lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tobias Kieslich wrote:
That shall be easy enough to write. Now for hash tables the "if empty"
expression is not as easy but that always depends on the situation.

Please ignore me if this makes no sense (I've never used/needed a templating engine in Lua), but wouldn't the following "if" condition suffice for hash tables that are empty?

<elem l:for="i,v in ipairs(table)" l:strip="">
	<b>${i}.</b> <span>${v}</span>
</elem>
<elem l:if="next(table)==nil">
	It was just empty, too bad :(
</elem>

 - Peter Odding