[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] coops, instance-of?
From: |
Kon Lovett |
Subject: |
Re: [Chicken-hackers] coops, instance-of? |
Date: |
Mon, 13 Jun 2016 08:18:30 -0700 |
> On Jun 13, 2016, at 5:59 AM, John J Foerch <address@hidden> wrote:
>
> Hello,
>
> I was pruning dependencies from a program of mine recently, and noticed
> that I was using coops-utils only for 'instance-of?'. The thought
> occurred to me that as 'instance-of?' is such a common and useful
> operation, perhaps it belongs in coops proper. I wanted to at least put
> the idea out there and see what people thought. It would be a bit
> self-serving for me, as I could drop several dependencies from my
> program if this change were made.
Hum, something get added to coops. Suggest you define the following in your
code:
(define-inline (*subclass? c1 c2) (or (eq? c1 c2) (subclass? c1 c2)))
(define (instance-of? x class) (*subclass? (class-of x) class))
subclass? & class-of are part of coops.
>
> Thank you,
>
> John Foerch
>
>
> _______________________________________________
> Chicken-hackers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-hackers