It seems to make things harder. How would you write a function that takes 3 "elements" and arranges them in a certain way? (def something (a b c)
(re-arragne a b c))
The problem is: a, b and c have already been evaluated, so what you will end up with is (roughly): <output of a>
<output of b>
<output of c>
<empty structure generated by re-arrange>
So everything now has to be a macro, to prevent arguments from evaluating before the structure is generated. It just makes things harder and counter intuitive.Let's look at 'row, it takes objects and prints them: arc> (row 1 2 3)
<tr><td>1</td><td>2</td><td>3</td></tr>"</tr>"
But it can also take expressions that print html: arc> (row (tag div (pr 1)) 2 3)
<tr><td><div>1</div></td><td>2</td><td>3</td></tr>"</tr>"
How does it do that? Let's look at the definition: (mac row args
`(tr ,@(map [list 'td _] args)))
Too many tricks. Too clever.What's the point? Wouldn't it be easier if everything just returned strings and then these strings were concatenated together? This way, 'row can be just: (def row args
(tab:tr (apply td args))
Or something like that. |