John Tobey wrote: > > > even if you all take you marbles and go home tomorrow.
Very unlikely: I lost my marbles years and years ago. > > Scheme already has an encapsulation mechanism: closures! It should be > "(<type> 'make) ((obj 'is-a?) <type>) (obj 'field)" and either "(set! > (obj 'field) value)" or "((obj 'set!) 'field value)" according to your > tastes. [....] > The only trick is to get a compiler smart enough to make something > like C++ virtual tables out of it. You'll want a fast, global property table with that, although you might want to make it easy to limit which modules can access that property table directly. You still need a way to implement "(record? <datum>)", for example. Implementing a really good global property table like that is interesting in two ways. First, if it is fast (and especially if it is optimized for some special case property names like small exact integers), then it instantly turns scheme into an everything-is-an-object, prototype-based object oriented programming language (albeit, with a higher level MOP left as an exercise for the interested reader). Second, the implementation burden of providing something like an efficient property table is technically similar, in interesting ways, to the implementation burden of adding user-defined record types. It's very similar work logically, and often pragmatically -- which perhaps should give us a hint about piling on features. We could give it some original name.... oaklisp? -t _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
