[gambit-list] define-type

lowly coder lowlycoder at huoyanjinjing.com
Tue May 26 18:53:49 EDT 2009


sorry for spamming, here's actually what I really want to do (and maybe
there's an easier solution than figuring out how define-type works)
I have:

(define-type shape ...)
(define (shape-draw shape) ...)

(define square (make-shape ...))
(define circle (make-shape ...))

Now, I want (square 'draw) to call (shape-draw square) and (circle 'draw) to
call (shape-draw circle)

how do I make this link?

thanks!

On Tue, May 26, 2009 at 3:43 PM, lowly coder
<lowlycoder at huoyanjinjing.com>wrote:

> oh wait, this is in lib/_nonstd.scm, I guess this explains why
> documentation has been so hard to come by.
> can anyone explain how:
>
> (define-prim (##define-type-expand ...) ... in lib/_nostd.scm ) works ?
>
> it seems like an _awful_ lot of code to setup a few macros ... so there
> must be something magical (optimizations) going on that I'm not aware of.
>
> Thanks!
>
>
> On Tue, May 26, 2009 at 3:19 PM, lowly coder <lowlycoder at huoyanjinjing.com
> > wrote:
>
>> Hey,
>>   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.
>>
>> Thanks!
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090526/b5e989b3/attachment.htm>


More information about the Gambit-list mailing list