lowlycoder at huoyanjinjing.com
Wed May 27 16:44:45 EDT 2009
Another quesiton on define-type -- is there anyway to get back an unique
identifier for the type?
i.e. if I have:
(define f1 (make-foo ..))
(define f2 (make-foo ...))
(define b1 (make-bar ..)))
I want something so that
(equal? (type f1) (type f2)) and
(not (equal? (type f1) (type b1)))
the idea is then, I can do dispatching on types i.e.
(define (draw object)
((lookup-in-hash-table (type object)) object))
On Wed, May 27, 2009 at 5:14 AM, David St-Hilaire <sthilaid at iro.umontreal.ca
> lowly coder wrote:
>> Where is define-type documented? I can't find it in r5rs or in the gambit
>> documentation (though it is briefly mentioned in a tour of scheme through
>> gambit). define-type is really cool and I'm starting to run against my
>> limited knowledge of it.
> Hi there!
> I've put some of Marc's undergrad notes related to define-type in the
> gambit-c wiki a while ago:
> Hope it can help!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list