Restructure LIAR's lists of foldable variables and primitives.
Treat global variables and primitives separately when enumerating the
global boolean-valued, function, or side-effect-free operators. This
re-enables LIAR's constant-folding after it was defeated by earlier
changes to bind global variables to compiled procedures that call
primitives, rather than to bind them to the primitives.
Fix bug in recent transformations that caused inadvertent shadowing.
The real fix is to make cgen do alphatization, in which case copy.scm
could be considerably simplified, but this hack works for now to fix,
e.g., miscompilation of INITIALIZE-PACKAGE! in runtime/emacs.scm,
which has
(let ((type (select-console-port-type)))
(if (let ((type (port/type the-console-port)))
(or (eq? type vanilla-console-port-type)
(eq? type emacs-console-port-type)))
(set-port/type! the-console-port type)))
=>
(let ((type (select-console-port-type)))
(let ((type (port/type the-console-port)))
(if (or (eq? type vanilla-console-port-type)
(eq? type emacs-console-port-type))
(set-port/type! the-console-port type))))
One of the variables formerly named TYPE is now named by an uninterned
symbol instead.
Make AUTOMAGIC-INTEGRATIONS search recursively, so that it transform
(let ((foo cdr))
(cdr x))
into
(cdr x),
which will then be open-coded. I believe AUTOMAGIC-INTEGRATIONS
formerly made no changes that improved the code LIAR generates; now
this change does improve the code that LIAR generates. This idiom
arises mainly in macros and in integrated procedures.
Fix bugs in previous changes that this change uncovered: when
integrating compound operators and conditional predicates, bail if
any open blocks are involved; handling them is too complicated.
Reverse sense of ordering in argument type string to reflect reality.
Fixes
(set-hash-table/rehash-size! (make-hash-table) -1.2)
;The object -1.2, passed as an argument to set-hash-table/rehash-size!, is not a real number < 1 or exact integer >= 1.
Fix hygiene in top-level bindings of synthetic identifiers.
Make such bindings globally unique by creating them with uninterned
symbols, bypassing the alpha renaming which was making them look
prettier at the expense of global uniqueness.
This code was fragile, and has neither worked nor even been reached
in at least eight years, so eliminating it doesn't really reduce any
functionality.
Teach SF to pull LETs and BEGINs out of IF predicates.
LIAR doesn't do a very good job with disjunctions not immediately in
the predicate position of IFs. It still doesn't do a very good job
with (OR X (LET ((Y ...)) (OR ...))), but this helps it a little to
reduce needless pushing and popping of #F on the stack.
Chris Hanson [Mon, 7 Sep 2009 23:12:11 +0000 (16:12 -0700)]
Eliminate remaining uses of SET-STRING-MAXIMUM-LENGTH!. Fix some bugs
in implementation of STRING-HEAD!. Use similar technique to implement
STRING-MAXIMUM-LENGTH.
Change PARSE-DEFINE-FORM from returning two values to taking a
continuation that must take two arguments and return a form, because
ILL-FORMED-SYNTAX does not signal an error but returns a form
classifying which signals an error.
Chris Hanson [Sun, 30 Aug 2009 09:17:16 +0000 (02:17 -0700)]
Refactor XML library to support names that don't conform to XML
Namespaces. This was extensive mostly because there was a built-in
assumption that all XML names could be mapped to QNames, which isn't
true. Some incompatible changes:
Chris Hanson [Sun, 30 Aug 2009 07:08:31 +0000 (00:08 -0700)]
Change "code point" to "scalar value" everywhere. Change "wide char"
to "unicode char" everywhere. Relax the definition of a well-formed
scalar-value list so that it allows overlaps, unsorted elements, and
non-canonical pairs.
Matt Birkholz [Thu, 27 Aug 2009 23:34:34 +0000 (16:34 -0700)]
Fix CREF's spurious "Bindings with Multiple Definitions" warnings.
* redpkg.scm (process-globals-info): Ensured that each definition,
internal and exported, is created once, with a unique expression.
(for-each-exported-name): New.
(bind!): There should now be no need to avoid adding an expression to
a value-cell more than once.