
Feb. 3, 2003
7:14 a.m.
From: "Walter Dörwald" <walter@livinglogic.de>
With blocks ifs and fors could look like this:
node = html.table(border=0, cellpadding=0): html.tr(): html.th(): "foo" html.td(): "bar" if cond: html.tr(): html.th(): "spam" html.td(): "eggs" for i in xrange(10): html.tr(): html.th(): i html.td(): i*i
this assumes that there's a way to evaluate a thunk as an expression or such that it has the value of the last expression that appears in it. Otherwise, you would have to write things using 'value' direct-return: html.th(): value i regards.