Closed gilch closed 7 years ago
Does #1050 meet your need here?
I think it does. I did implement the improved partition #928, but had to change the argument order from Clojure's, since Clojure-style arity overloading still isn't available in core. I'm not sure we should move it into core just yet though.
Yeah, I think going by our new policy for hy.contrib, it should stay in hy.contrib for a while, till it's been battle-tested and we're fairly sure we like it how it is. Then we can move it to core.
My improved partition #878, is kind of waiting on this. I'm kind of considering a pull without Clojure's argument order so I don't have to.
We've established that
defmulti
is a terrible name, since it's not actually multimethods, but just Clojure-style arity overloading. Unlike Python's usual arity overloading options--optional arguments and tuple packing--Hy'sdefmulti
still supports keywords properly when the argument order changes.If we can get this in core, I think it should just be baked into
defn
rather than getting a new name. Thedefn
macro will have to detect if it's being used asdefmulti
instead of adef
fn
.