lowlycoder at huoyanjinjing.com
Thu May 28 04:56:33 EDT 2009
It appears ##structure-type is what I want.
Anyone smarter than me want to either:
(1) confirm this is the right answer
(2) tell me why using ##structure-type for this purpose is a bad idea?
On Wed, May 27, 2009 at 1:44 PM, lowly coder
<lowlycoder at huoyanjinjing.com>wrote:
> Cool, thanks!
> 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> wrote:
>> 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