Predicate generic functions Ben Davenport-Ray (28 Jul 2021 15:22 UTC)
Re: Predicate generic functions Peter (28 Jul 2021 16:50 UTC)
Re: Predicate generic functions Arthur A. Gleckler (28 Jul 2021 19:21 UTC)
Re: Predicate generic functions Arthur A. Gleckler (28 Jul 2021 20:14 UTC)
Re: Predicate generic functions John Cowan (28 Jul 2021 22:20 UTC)
Re: Predicate generic functions Arthur A. Gleckler (29 Jul 2021 03:36 UTC)
Re: Predicate generic functions Amirouche Boubekki (29 Jul 2021 05:18 UTC)
Re: Predicate generic functions Alex Shinn (09 Aug 2021 19:53 UTC)
Re: Predicate generic functions John Cowan (10 Aug 2021 22:49 UTC)
Re: Predicate generic functions John Cowan (01 Aug 2021 00:11 UTC)
Re: Predicate generic functions me@xxxxxx (03 Aug 2021 18:16 UTC)
Re: Predicate generic functions Ben Davenport-Ray (07 Jan 2022 18:21 UTC)
Re: Predicate generic functions John Cowan (11 May 2022 16:04 UTC)

Re: Predicate generic functions Peter 28 Jul 2021 16:50 UTC

Hello!

> I've been noodling on the generic procedures/polymorphism problem for
> a bit, but the huge discussion on this list about it has prompted me
> to make my work public.
> Check it out at
> https://github.com/laserswald/pre-srfi-generic-procedures , pull
> requests, comments, and even complaints are more than welcome! I think
> this would be a good SRFI for the CLOS style OO implementation, but I
> think we should have other SRFIs for other kinds of polymorphism.
> It's based a little bit on Clojure's multimethods, where there is an
> explicit hierarchy structure that controls resolution.

This looks nice, just like something I've been using for a while, it
works rather well (even though I'm not sure how well it can be
optimised).

Just one quick idea, maybe think about reversing the order of predicate
and name, so instead of

  (define-method (elt (coll list?) idx) (list-ref coll idx))

you would have

  (define-method (elt (list? coll) idx) (list-ref coll idx))

which to me reads more naturally and also is the same order as an actual
function call would be ;)t

I'll study the text und come back with more comments later ;)

Thanks for publishing this!
Greetings, Peter