John Tobey scripsit: > 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 problem is that ((obj 'is-a?) foo) returns undefined results if obj is not an object, whereas it can be guaranteed that the (foo? obj) generated by a record library returns #f if obj is not a foo. Furthermore, if obj is a closure not being used to represent an object, one may get a false positive from (obj 'is-a), e.g. if obj is symbol?. No, the irreplaceable thing about records, no matter how you slice it, is their ability to create novel disjoint types. -- My corporate data's a mess! John Cowan It's all semi-structured, no less. http://www.ccil.org/~cowan But I'll be carefree [EMAIL PROTECTED] Using XSLT On an XML DBMS. _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
