Chris Hanson [Mon, 7 May 2018 07:00:24 +0000 (00:00 -0700)]
Fix bug: error:file-operation couldn't work properly.
This is because substitutable-value-condition-signaller was mis-designed. It
added retries *after* building the condition, so they weren't in the condition
and would never be shown.
I rewrote error:file-operation based on the model in microcode-errors.scm which
was apparently a workaround for the fact that error:file-operation didn't work.
This entailed a small but incompatible change to the procedure's arguments.
Chris Hanson [Sun, 29 Apr 2018 05:09:56 +0000 (22:09 -0700)]
Integrate applicable records into the procedure abstraction.
Also, don't allow applicable records to be made non-applicable. This sort of
satisfies the idea that predicates aren't time-varying, provided that the record
type's applicator is set immediately after definition.
Chris Hanson [Sat, 28 Apr 2018 05:21:38 +0000 (22:21 -0700)]
Change hash tables to use define-record-type instead of define-structure.
This has the advantage of eliminating the need for nearly all of the calls to
guarantee, which should at worst be a net wash and at best will be slightly
faster. (Not a big deal either way.)
A second advantage is, of course, eliminating the use of define-structure.
Chris Hanson [Sat, 28 Apr 2018 04:59:58 +0000 (21:59 -0700)]
Fix breakage I caused with a previous refactoring.
The procedures hash-table-update! and hash-table/modify! were not equivalent, as
I blindly assumed during the refactor. Changing hash-table-update! to use the
same implementation as hash-table/modify! caused the unit tests to fail, because
that implementation couldn't implement the tested behavior.
Rather than try to fix the implementation, I reverted hash-table-update! to its
previous implementation. The rationale for this is that fixing the implementation
would effectively eliminate its performance advantage, while still being hard to
understand. The older implementation is trivial to understand and eliminates
the restriction that the update procedure not use the hash table.
An additional complication arose because the previous implementation of
hash-table-update! returned an unspecified value, which broke hash-table-intern!
and caused hash-table/modify! to differ from its previous behavior. I fixed
these by rewriting them without using hash-table-update!.
Chris Hanson [Wed, 25 Apr 2018 03:50:37 +0000 (20:50 -0700)]
Refactor hash-table to clean up some issues noted in previous change.
* Export former %make-hash-table as make-hash-table*.
* Create new make-hash-table-type* which can create a type given an equality
predicate and some keyword options. If the equality predicate has registered
properties, no additional options may be necessary, except perhaps to choose
the entry type (which is specified by name).
* Change make-hash-table to accept the same options as make-hash-table-type* and
to use the same defaulting.
* Change internal procedure follow-memo-crap to hash-metadata, which more
accurately reflects its purpose: to get a properties table for the primary
hash parameters.
Chris Hanson [Mon, 23 Apr 2018 06:34:31 +0000 (23:34 -0700)]
Standardize hash tables on SRFI-69 names and deprecate others.
Change make-hash-table to be smarter about choosing the appropriate hash
function for a given equality predicate.
Also work around name collisions in rtlopt/rcse*.scm, and tweak the hash-table
implementation to favor SRFI-69.
Some work remains: the code around building hash-table types needs to be
re-thought: it's a little clunky and could usefully take advantage of keyword
arguments. (These keyword arguments should also be supported by
make-hash-table.) The hash function should be optional and use the
equality-predicate default. The older %make-hash-table should be renamed and
exported as it's the right interface when using types.
Chris Hanson [Mon, 16 Apr 2018 02:16:56 +0000 (19:16 -0700)]
Implement scode-procedure-arity so that it can be run during cold load.
The lack of this prevented the cold load from running correctly when using
interpreted code, since it depended on a complex scode lambda implementation
that was loaded much later.
Chris Hanson [Sun, 15 Apr 2018 08:16:23 +0000 (01:16 -0700)]
Change find-{,not-}matching-items procedures to call find instead.
Also eliminate find-unique-{,not-}matching-items procedures which aren't used
and aren't documented. These are trivially solved with find-tail and any.
Chris Hanson [Sun, 15 Apr 2018 07:49:20 +0000 (00:49 -0700)]
Eliminate references to various list filters in favor of SRFI-1.
One unfortunate development is that somewhere in the compiler is some code that
depends on the result of a filtering option being newly allocated, while FILTER
shares the tail of the input list when it can. I modified FILTER to stop doing
that, because it wasn't obvious which of the modified calls in the compiler was
causing the problem.