Chris Hanson [Thu, 13 Mar 2003 20:06:41 +0000 (20:06 +0000)]
Eliminate #F argument to TYPE-DESCRIPTOR option as it's no longer
needed. Change call to MAKE-DEFINE-STRUCTURE-TYPE so that the length
of the structure is supplied, rather than the offset.
Chris Hanson [Thu, 13 Mar 2003 03:58:18 +0000 (03:58 +0000)]
Change DEFINE-STRUCTURE to generate type descriptors for all
structures, including untagged ones. This will simplify some
operations that need access to the type descriptor.
The default name to which the type descriptor is bound has been
changed to RTD:foo where "foo" is the structure's root name.
For the runtime cold load, allow TYPE-DESCRIPTOR option to accept #F
as an argument so that the structures defined in "packag.scm" don't
try to build a type descriptor. This is important because this file
is loaded prior to the type-descriptor infrastructure. A consequence
of this change is that the TYPE-DESCRIPTOR option no longer implies
tagging. This is independently specified by the NAMED option, and
these two options are permitted to be used together.
Add TAG and OFFSET fields to the runtime type descriptor for
non-record structures. In the next revision, this will allow building
more efficient constructors.
Chris Hanson [Wed, 12 Mar 2003 20:41:42 +0000 (20:41 +0000)]
Change both records and named structures to store default values as
thunks in the type structure, which are then called when needed.
Introduce new procedures to get the default value for a slot, given
the type descriptor, and use them as needed in DEFINE-STRUCTURE,
rather than just inserting the default-init expression.
Put back the UNPARSER-METHOD argument to MAKE-RECORD-TYPE, and use it
in DEFINE-STRUCTURE.
Once again, use RECORD-KEYWORD-CONSTRUCTOR in DEFINE-STRUCTURE, this
time with better results.
Chris Hanson [Tue, 11 Mar 2003 05:01:21 +0000 (05:01 +0000)]
Change both records and named structures to store default values as
thunks in the type structure, which are then called when needed.
Introduce new procedures to get the default value for a slot, given
the type descriptor, and use them as needed in DEFINE-STRUCTURE,
rather than just inserting the default-init expression.
Put back the UNPARSER-METHOD argument to MAKE-RECORD-TYPE, and use it
in DEFINE-STRUCTURE.
Once again, use RECORD-KEYWORD-CONSTRUCTOR in DEFINE-STRUCTURE, this
time with better results.
Chris Hanson [Mon, 10 Mar 2003 20:53:51 +0000 (20:53 +0000)]
Eliminate incorrect usage of default initializers in DEFINE-STRUCTURE.
These initializers contain variable references that are intended to
refer to other slots in the structure. The correct usage assumes that
the initializers are closed in the environment in which the
DEFINE-STRUCTURE form appears.
Chris Hanson [Sat, 8 Mar 2003 05:28:29 +0000 (05:28 +0000)]
Don't save DEFAULT-RECORD, go back to using DEFAULT-VALUES.
DEFAULT-RECORD has the problem that when the defaults aren't
specified, often the record can't be printed, which makes examining
the structure painful.
Chris Hanson [Sat, 8 Mar 2003 04:53:58 +0000 (04:53 +0000)]
Revert earlier change to use RECORD-KEYWORD-CONSTRUCTOR, because it
doesn't handle default values right.
Actually, I don't think it can do so, because DEFINE-STRUCTURE has
default expressions rather than default values; the expressions are
intended to be evaluated within the context of the constructor. I
think this is a design flaw, but I'm not yet sure whether it is OK to
fix the design.
Chris Hanson [Fri, 7 Mar 2003 05:48:36 +0000 (05:48 +0000)]
Revamp the record abstraction. Record types now have a "default
record" that can be used as a template to speed up record
construction, and to hold default slot values. Eliminate optional
print-method argument to MAKE-RECORD-TYPE, replacing it with an
optional default-values argument. Tune record constructors to be very
fast for those cases where it is easy to do so. Change RECORD-COPY to
COPY-RECORD.
Chris Hanson [Fri, 7 Mar 2003 05:42:38 +0000 (05:42 +0000)]
Revert most of previous change. Instead introduce new procedures
LIST?->LENGTH and LIST-OF-TYPE?->LENGTH (yes, I know these names suck;
I'm open to suggestions). Also introduce corresponding GUARANTEE
procedures.
Chris Hanson [Thu, 6 Mar 2003 15:28:48 +0000 (15:28 +0000)]
Change LIST?, ALIST?, and LIST-OF-TYPE? to return the length of the
list when true. New procedures GUARANTEE-LIST, GUARANTEE-ALIST, and
GUARANTEE-LIST-OF-TYPE. Replace GUARANTEE-INDEX/LIST with
GUARANTEE-INDEX-FIXNUM.
Chris Hanson [Wed, 5 Mar 2003 01:14:40 +0000 (01:14 +0000)]
Restructure XML output procedures to take a rest argument that is a
list of keyword options. At present, there is only one option,
'start-indent, which turns the indentation on or off.
Chris Hanson [Sat, 1 Mar 2003 16:53:39 +0000 (16:53 +0000)]
Major rewrite, primarily to eliminate XML-UNINTERPRETED, replacing it
with XML-ENTITY-REF and XML-PARAMETER-ENTITY-REF. Also add careful
type checking to data structures, so that argument structure is
verified.
Chris Hanson [Thu, 13 Feb 2003 02:46:41 +0000 (02:46 +0000)]
Fix interaction between LET-SYNTAX and definitions. Previously
a definition inside a LET-SYNTAX changed the environment outside the
LET-SYNTAX. Now it changes the environment inside the LET-SYNTAX, as
it is supposed to.
Chris Hanson [Wed, 12 Feb 2003 19:40:38 +0000 (19:40 +0000)]
Properly fix problem with LETREC/definition interaction. This
requires an extra environment frame in the syntax expander, to model
the frame that is potentially inserted in the output. And we must
continue to use the "auxiliary" variable mechanism, since the compiler
and several other things depend on it in order to recognize
LETREC-like structures.
Chris Hanson [Sun, 9 Feb 2003 01:58:09 +0000 (01:58 +0000)]
Fix bug in output of LETREC expressions: internal definitions within
the LETREC must be rewritten as a nested LETREC. Previously they were
merged into the outer LETREC.