pixie-lang/pixie — pull request #91 by heyLu (2014-11-23 20:41:43+00:00)
Title: Support for multimethods

This was surprisingly easy, so perhaps I'm missing something. I have *not* implemented hierarchies so far, and probably won't for this PR. I *am* pretty happy that we can implement this without modifying the runtime.

Before merging I'd like to add a few tests tomorrow.

Here's what works so far:

```clojure
(defmulti greet first)

(defmethod greet :hi [[_ name]] (print "Hi, " name "!"))
(defmethod greet :hello [[_ name]] (print "Hello, " name "."))
(defmethod greet :default [_] (print "Uh, hi, hrglmbl."))

(greet [:hi "friend"])
; Hi, friend!

(greet [:hello "friend"])
; Hello, friend.

(greet [:mystery])
; Uh, hi, hrglmbl.
```