<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br></div><div>Do you want to serialize instances? </div><div><br></div><div>Personal preference: I tend to start programming with modules that are class-like: </div><div><br></div><div>#lang scheme</div><div> ;; structs for datatype Foo</div><div> (define-struct foo (moo bar))</div><div> -- functions </div><div> (define (f a-foo x y z) ...)</div><div> (define (g a-foo x) ...) </div><div> (define (h a-bar) ...)</div><div><br></div><div>I almost always use a "with" macro that opens up instances of Foo in these functions. </div><div><br></div><div>When I see the design need for classes, I switch and it tends to be easy. -- Matthias</div><div><br></div><div><br></div><br><div><div>On Jul 26, 2008, at 7:30 AM, Circular Function wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">I am playing with the Netflix recommendation system which involves 17K+files and massive amounts of data.<br><br>I want to represent (and save) the parsed data in various forms and Python like classes would be perfect.<br><br>Should I use defstruct or classes? classes seem complicated and not exactly as classes in other languages.<br><br>I want to represent Customer as:<br><br>class Customer:<br> def __init__(self, idnumber):<br> self.idnbr = idnumber<br> self.reviews = []<br><br> def addReview(self, review):<br> self.reviews.append(review)<br><br> def hasReview(movieId):<br> doSomething<br> <br><br></td></tr></tbody></table><br> <hr size="1"> Går det långsamt? Skaffa dig en snabbare bredbandsuppkoppling.<br> <a href="http://www.kelkoo.se/c-100015813-bredband.html?partnerId=96914325">Sök och jämför priser hos Kelkoo.</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_________________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>For list-related administrative tasks:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span><a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a></div> </blockquote></div><br></body></html>