Log in

Different Categories of Categories

Before adding -c3- and -pred- to the Scheme version of Categories, I thought I'd see how long it would take to do the port back to Clojure. Turns out not very long at all. It's done (at least, to the same point as the Scheme version).

I wondered how to two versions would compare. The Clojure version is about 800 lines of code; the Scheme version is about 900. Pretty close. One important difference is that Clojure provides some amenities that R5RS Scheme doesn't--mainly, it provides a handy built-in associative array type, and a (slightly non-obvious) way to define your own appliable function-like objects. Those are definitely conveniences. So how come the size advantage of Clojure wasn't greater? Well, that's Scheme for you, I guess. Even when you write your own implementation of record types, it's not that much code.

So can you get the Clojure version yet? No. I want to add in -c3- and -pred- first, and fix a bug I found in the 0.1 release (the bowels of the Category code uses the wrong predicate function in once place). n good news, Categories 0.2 should be available soon, and it'll include the Clojure version. I'm speculatively eyeing R6RS now, wondering how much work it would be to make a version for that Scheme standard. Actually, it's more like I'm curious what the new features in R6RS might buy me. And I'm also idly wondering what the results would be like if I did a version in Common Lisp.

Stay tuned.



Assoc in R5RS

Assoc in R5RS might give you what you wanted.

Re: Assoc in R5RS

Or not.

February 2010

Powered by LiveJournal.com