Kon Lovett <[email protected]> writes: >> On Jun 13, 2016, at 5:59 AM, John J Foerch <[email protected]> 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. >
Alright, thank you for the suggestion. I am just curious whether others feel as I do that 'instance-of?' is an important enough operation that it could be promoted into the coops egg. Personally I find that I use it in just about every coops program I write. Thank you, -- John Foerch _______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
