<br><div><span class="gmail_quote">On 9/6/07, <b class="gmail_sendername">Eli Barzilay</b> <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> The classes that you get from `struct-type->class' are intended for<br>> generic function dispatching only. Making <make> work with these will<br>> require much more work.</blockquote><div><br>
Yeah I'm finding that out the hard way :) <br><br>As written in the message <a href="http://list.cs.brown.edu/pipermail/plt-scheme/2007-September/020471.html">http://list.cs.brown.edu/pipermail/plt-scheme/2007-September/020471.html
</a>, I am able to get the initial part going by <br><br>1) modify extra.ss to export struct-type->class* <br>2) wrap around define-struct* and struct-type->class* <br><br>but I ran into a few issues and have some questions:
<br><br>1) why does a procedurized struct returns a swindle instance if called via <make>? struct-type->class appear to catch whether a struct-type is procedure and changes the super class to <procedure-class>, but why do that when the returned instance cannot be called as a procedure?
<br><br>2) Also, it appears that procedurized struct cannot be inherited in swindle object system. Trying to do so either with my hacks or with struct-type->class would raise an error: <br><br>; with the sample code in
<a href="http://list.cs.brown.edu/pipermail/plt-scheme/2007-September/020471.html">http://list.cs.brown.edu/pipermail/plt-scheme/2007-September/020471.html</a><br>> (defstruct* <foo1> (value)<br> (#:guard (lambda (value struct)
<br> (values value)))<br> (#:procedure (lambda (x) x)))<br>> (defstruct* (<foo2> <foo1>) ())<br>. . collects\swindle\tiny-clos.ss::7069: top-sort: invalid constraints<br><br>Looking through the code it's not obvious where the constraint is created, but I am assuming that the design is that a procedure has a constraint that it cannot be inherited - correct? If such struct cannot be inherited it would seem to limit generic function applicabilities.
<br><br>3) if such integration is too far-fetched right now - does swindle integrate well with non swindlized structs? <br><br>Any pointers are appreciated. Thanks! ;)<br>yc<br><br><br></div></div>