what i think would be nice here is multimethods taking multiple
dispatch functions. (i'm not sure how you'd do that without breaking
the default value syntax)
so it'd try the first function, and if it doesn't match any method,
then it tries the second, etc. then :default, then throws an exception
All multimethods have :default as the default fallback value,
regardless of what the dispatch function is. But I assume that only
works with single values. Maybe what you want is TWO multimethods,
one that dispatches on the first value, then calls the second
multimethod to dispatch on the other
On Nov 16, 12:36 am, samppi <[EMAIL PROTECTED]> wrote:
> Is there a way to get a value—call it 'anything—so that (isa? anything
> x) is always true for any x?
>
> I need this for multimethod dispatch—sometimes, I want a method to
> ignore some of the stuff its dispatch function returns:
>
> (d
Is there a way to get a value—call it 'anything—so that (isa? anything
x) is always true for any x?
I need this for multimethod dispatch—sometimes, I want a method to
ignore some of the stuff its dispatch function returns:
(defmulti a #(%1 %2))
(defmethod a [3 2] [x y] ...)
; in this met