<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello all.<div><br></div><div>I have become quite in the habit of using the following:</div><div><br></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span><font color="#a77b00">(</font>define/contract <i><font color="#0042aa">id</font></i></font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span> <font color="#a77b00">(</font>class/c </font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span> <i><font color="#0042aa">class-contract-clause</font></i> ... <font color="#a77b00">)</font> </font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span> </font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span> <font color="#a77b00">(</font>class* <i><font color="#0042aa">superclass-expr</font></i> <font color="#a77b00">()</font></font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre">        </span> <i><font color="#0042aa">class-clause</font></i> ... <font color="#a77b00">))</font></font></div><div><br></div><div><br></div><div>Now I need to be able to make a whole slew of my classes serializable. From Racket Reference, it looks like my only option is to use the "define-serializable-class*" syntax:</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div></div><div><br><br><table cellspacing="0" class="RktBlk RForeground" style="white-space: nowrap; text-align: left; position: relative; left: 0px; top: 0px; z-index: 1; color: rgb(0, 0, 0); background-color: rgb(232, 232, 255); "><tbody><tr style="white-space: inherit;"><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit;"><font face="Courier"><span class="RktPn" style="white-space: inherit; color: rgb(132, 60, 36); ">(</span><a name="(form._((lib._racket/private/class-internal..rkt)._define-serializable-class*))"></a><span title="Provided from: racket/class, racket"><span class="RktSym" style="white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3.4/doc/reference/objectserialize.html?q=serialize&q=hash&q=hash-set%21&q=call-with-current-continuation&q=hash&q=sort&q=member&q=cond&q=vector&q=unimplemented&q=vector&q=-%3Em*&q=class-c&q=procedure&q=object-name&q=void&q=exn%3Afail&q=set-member%3F&q=procedure-rename&q=contract-out&q=all-from-out&q=struct&q=contract-out&q=sequence&q=hash/c&q=hash&q=in-generator&q=generator-%3Esequence&q=let*&q=ormap&q=in-range&q=for&q=vector-%3Eimmutable-vector&q=in-vector&q=argmin&q=vector&q=for&q=sequence&q=augment-final&q=set&q=sequenceof&q=send*&q=foldl&q=comprae&q=class/c&q=define-struct&q=methods&q=print&q=integer-in&q=substring&q=string-%3Enumber&q=range&q=exn#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._define-serializable-class%2A%29%29" class="RktStxLink" data-pltdoc="x" style="text-decoration: initial; color: black;">define-serializable-class*</a></span></span><span class="hspace"> </span><span class="RktVar" style="white-space: inherit; color: rgb(38, 38, 128); font-style: italic; ">class-id</span><span class="hspace"> </span><span class="RktVar" style="white-space: inherit; color: rgb(38, 38, 128); font-style: italic; ">superclass-expr</span></font></td></tr><tr style="white-space: inherit;"><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit;"><font face="Courier"><span class="hspace"> </span><span class="RktPn" style="white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktVar" style="white-space: inherit; color: rgb(38, 38, 128); font-style: italic; ">interface-expr</span><span class="hspace"> </span><span class="RktMeta" style="white-space: inherit; ">...</span><span class="RktPn" style="white-space: inherit; color: rgb(132, 60, 36); ">)</span></font></td></tr><tr style="white-space: inherit;"><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit;"><font face="Courier"><span class="hspace"> </span><span class="RktVar" style="white-space: inherit; color: rgb(38, 38, 128); font-style: italic; ">class-clause</span><span class="hspace"> </span><span class="RktMeta" style="white-space: inherit; ">...</span><span class="RktPn" style="white-space: inherit; color: rgb(132, 60, 36); ">)</span></font></td></tr></tbody></table></div></blockquote><div><div><br></div></div><div><br></div><div>I don't see how I can attach class contracts to my classes if I use this, but having class contracts is really import to me to catch bugs.</div><div><br></div><div>Can anyone tell me if there is a way to define serializable classes that still have contracts attached to them?</div><div><br></div><div>Thanks,</div><div><br></div><div>Christopher</div></body></html>