From: Andrew Wilcox <schematics-dev@an...> - 2005-04-16 19:14:10
As a first step in the port of SchemeUnit to SISC, I'm looking at
features of MzScheme that SchemeUnit uses, that I can easily and
conveniently implement in SISC.
SchemeUnit uses the subtype feature of MzScheme's DEFINE-STRUCT.
SchemeUnit also supplies a structure inspector; however, this does not
appear to be used by SchemeUnit itself. All SchemeUnit unit tests
still pass in MzScheme when the structure inspector is removed.
SISC has a MzScheme compatible implementation of DEFINE-STRUCT
provided by its RECORD module, but SISC's implementation does not
I've written an implementation of DEFINE-STRUCT for SISC which does
include subtypes. While it doesn't implement structure inspectors,
a structure inspector may be specified (and will be ignored) for
compatibility with code written for MzScheme.
Structures created by this code are actually SISC classes. Thus:
(define-struct s (field1 field2))
defines "s" as an SISC class, and
(define-struct (t s) (field3 field4 field5))
defines "t" as a subclass of "s".
Likewise, fields are implemented as class slots, and field
accessors and modifiers (S-FIELD2, SET-T-FIELD3!, etc.) are
implemented as generic procedures on the classes.
User-friendly error checking is not performed.
The code may be downloaded as a zip file from
The code is also available within a GNU Arch project named
within the src/name/andrewwilcox/mzcompatible directory.
The GNU Arch archive is published at:
and may be accessed from GNU Arch with commands such as:
tla register-archive http://code.andrewwilcox.name/2005
tla get code@.../dev--a--0
The distribution contains code from SISC's record.scm, and so is
covered by SISC's copyright.
Code that I wrote is dedicated to the public domain.
I'll be on vacation next week, so it will probably be a couple of
weeks before I complete another step.
Get latest updates about Open Source Projects, Conferences and News.