moovweb / tritium

Tritium is a magical document modifying language. It's JavaScript-like and simple to learn. Think XSLT without the nightmare. It was designed by Hampton Catlin (@hcatlin), and has been heavily influenced by Aaron Leung (@akhleung).
http://tritium.io
Mozilla Public License 2.0
33 stars 7 forks source link

Expand concat and log #15

Closed akhleung closed 12 years ago

akhleung commented 12 years ago

log(a, b, c) -> log(concat(a, b, c))

concat(a, b, c, d) -> concat(concat(concat(a, b), c), d)

akhleung commented 12 years ago

Done. Note that the expansions will only be performed if log and concat are called without keyword arguments -- if they're called with keyword arguments, then the usual keyword arg expansion will occur, and if the wrong number of ordinal args were provided, then a link-time error will occur.

I assume that this behavior will suffice for now; I can make the expansion slightly more robust by the weekend.