what about:

(defmulti step-handler :type)
(defmulti get-schema :type)     ;; returns the schema

And make your users implement both? Remember schemas are first-class
values.


Saludos,
Nahuel Greco.


On Sat, Aug 23, 2014 at 8:08 AM, Laurens Van Houtven <[email protected]> wrote:

> Hi Nahuel,
>
>
> Thanks for your suggestion :)
>
> On 22 Aug 2014, at 19:31, Nahuel Greco <[email protected]> wrote:
>
> > why not multi methods?
>
> Multimethods definitely solve the registering a handler problem (because
> what I really want there is arbitrary dispatch), but don’t solve the “there
> must be two of these” problem. I guess I could write a macro for that, but
> I don’t know what the macro would have to have to register the
> prismatic/schema. I guess I’ll go digging to see if there’s anything in
> prismatic/schema that takes a multi-method, and still produces useful
> schema validation errors :)
>
> cheers
> lvh
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to