applicable structs

svn: r5937
This commit is contained in:
Eli Barzilay 2007-04-14 06:28:56 +00:00
parent e2a460e2d9
commit c798f43dbb
2 changed files with 15 additions and 12 deletions

View File

@ -152,6 +152,6 @@ Copyright (C) 1998-2007 Eli Barzilay (eli@barzilay.org)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
02110-1301 USA.
====< * >===============================================================

View File

@ -496,17 +496,20 @@
(define* (struct-type->class stype)
(hash-table-get
struct-to-class-table stype
(thunk (let-values ([(name init-field-k auto-field-k accessor mutator
immutable-k-list super skipped?)
(struct-type-info stype)])
(let* ([super (cond [super (struct-type->class super)]
[skipped? <opaque-struct>]
[else <struct>])]
[this (parameterize ([*default-object-class* #f])
(make <primitive-class>
:name name :direct-supers (list super)))])
(hash-table-put! struct-to-class-table stype this)
this)))))
(thunk
(let-values ([(name init-field-k auto-field-k accessor mutator
immutable-k-list super skipped?)
(struct-type-info stype)])
(let* ([supers (list (cond [super (struct-type->class super)]
[skipped? <opaque-struct>]
[else <struct>]))]
[proc? (procedure-struct-type? stype)]
[supers (if proc? (cons <primitive-procedure> supers) supers)]
[this (parameterize ([*default-object-class* #f])
(make (if proc? <procedure-class> <primitive-class>)
:name name :direct-supers (list super)))])
(hash-table-put! struct-to-class-table stype this)
this)))))
;;>>...
;;> *** Common accessors