The Urn Logo

Version 0.2.8 released

Because Urn updates are like London busses: you have to wait for ages, then several come at once.

Multiple returns from macros and top level unquotes.

This has been on the todo list for an age, and I’ve finally got round from it. One of the biggest limitations of macros was that they could only return one value, meaning anything which needed to define multiple variables wouldn’t work. As of this release, you can return multiple values from these, meaning multiple pieces of code can be spliced in. This commit also allows passing multiple values to top-level unquotes, as well as also allowing top-level unquote-splices. For instance:

,@(list
  `(define foo ,(* 2 3))
  `(define bar ,(+ 2 3))

will now evaluate the body of the unquote splice, and push it in, resulting in

(define foo 6)
(define bar 5)

It is worth noting that multiple returns can only be used in blocks (lambda and conditional bodies).

Code-gen improvements

I won’t re-iterate previous posts about code-gen issues, but this release has also seen significant code-size reductions (about 780 LOC). We’ve grown even smarter about detecting various conditional expressions, meaning complex, multi-line if statements can be reduced to a single line. You only need to look at the first line of the diff to see how effective this optimisation is. Looking over the compiled code, I feel we’ve reached the point where the emitted code isn’t high quality, but it is acceptable. We’ve come away since the initial release.