This is cool :)
It reminds me of subtyping between maps in Typed Clojure, where
{:a 1, :b 2} <: {:a Number}
Thanks,
Ambrose
On Wed, Jul 11, 2012 at 2:16 PM, Leif <[email protected]> wrote:
> Hi, everybody. I reimplemented the function isa? in terms of a protocol
> Is-A.
>
> The reason why you would want to do that is in the README at
> https://github.com/leifp/clj-isa-protocol
>
> tl;dr: One of the reasons why people are excited about predicate dispatch
> is the irritation caused by the dispatch function of a multimethod being
> closed. You have to decide up front what information the dispatch fn is
> going to pull out of your arguments. Changing it afterward is a pain.
>
> Since the dispatch uses 'isa?' internally, if that function is extensible,
> then multimethod dispatch becomes, to a certain extent, open. See the
> README.
>
> Comments, critique, code, and questions welcome.
>
> Cheers,
> Leif
>
> P.S. As an aside to people that like weird, obscure programming
> languages, the rough idea of how is-a? should work for maps was inspired by
> (but very much simpler than) the functional logic language LIFE [
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.90.3175 ]
>
> --
> 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 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