Chris Hanson [Sun, 20 May 2018 00:23:03 +0000 (17:23 -0700)]
Tweak pattern->spar to make it more useful.
Also add (cons* ...) pattern.
Chris Hanson [Sat, 19 May 2018 22:06:29 +0000 (15:06 -0700)]
Fix typo in DISPLAY.
Chris Hanson [Sat, 19 May 2018 06:42:54 +0000 (23:42 -0700)]
Implement define-values for R7RS.
Chris Hanson [Sat, 19 May 2018 06:21:05 +0000 (23:21 -0700)]
Split command-line processing out of load into its own file.
Also implement command-line for R7RS, renaming existing command-line to
command-line-arguments.
Chris Hanson [Sat, 19 May 2018 04:24:53 +0000 (21:24 -0700)]
Implement exact-integer-sqrt for R7RS.
Chris Hanson [Thu, 17 May 2018 07:08:53 +0000 (00:08 -0700)]
Implement CASE-LAMBDA for R7RS.
Chris Hanson [Thu, 17 May 2018 05:37:24 +0000 (22:37 -0700)]
Make sure that value of r4rs-lambda-list-arity is simplified.
Chris Hanson [Thu, 17 May 2018 05:16:19 +0000 (22:16 -0700)]
Implement fold-r4rs-lambda-list and r4rs-lambda-list-arity.
Chris Hanson [Wed, 16 May 2018 05:32:46 +0000 (22:32 -0700)]
Implement GUARD for R7RS.
Chris Hanson [Tue, 15 May 2018 04:48:25 +0000 (21:48 -0700)]
Change users of arity-dispatched-procedure to use the abstraction.
Chris Hanson [Tue, 15 May 2018 04:36:22 +0000 (21:36 -0700)]
Move the arity-dispatcher-tag from the microcode to the runtime system.
Chris Hanson [Tue, 15 May 2018 04:35:24 +0000 (21:35 -0700)]
Rewrite microcode-tables.scm for simplicity.
Also add a 'fixed-objects boot-actions list and change record.scm to use it.
Chris Hanson [Mon, 14 May 2018 19:31:25 +0000 (12:31 -0700)]
A few more fall-through comments.
Chris Hanson [Mon, 14 May 2018 19:29:35 +0000 (12:29 -0700)]
Add comments to suppress fall-through warnings in GCC 7.
Chris Hanson [Mon, 14 May 2018 04:54:30 +0000 (21:54 -0700)]
Apple doesn't need special definition for jiffies-per-second.
Chris Hanson [Mon, 14 May 2018 04:52:51 +0000 (21:52 -0700)]
Don't use CLOCKS_PER_SEC for the value returned by times().
Chris Hanson [Mon, 14 May 2018 04:29:35 +0000 (21:29 -0700)]
Add missing procedure in host-adapter.
Chris Hanson [Mon, 14 May 2018 04:20:23 +0000 (21:20 -0700)]
Implement CURRENT-JIFFY and JIFFIES-PER-SECOND for R7RS.
Very rough implementation, may return process time instead of real time on
non-POSIX systems.
Chris Hanson [Mon, 14 May 2018 03:06:41 +0000 (20:06 -0700)]
Implement CURRENT-SECOND for R7RS.
Chris Hanson [Mon, 14 May 2018 03:02:16 +0000 (20:02 -0700)]
Fix bug: earlier rewrite of printer broke pp.
Chris Hanson [Mon, 14 May 2018 02:43:57 +0000 (19:43 -0700)]
Implement get-environment-variables for R7RS.
Chris Hanson [Mon, 14 May 2018 02:43:42 +0000 (19:43 -0700)]
More R7RS tags.
Chris Hanson [Mon, 14 May 2018 00:15:59 +0000 (17:15 -0700)]
Rename GET-SUPPORTED-FEATURES to FEATURES for R7RS.
Also add some more R7RS comments to runtime.pkg.
Chris Hanson [Mon, 14 May 2018 00:13:21 +0000 (17:13 -0700)]
A bunch of changes to implement R7RS exit/emergency-exit.
* The EXIT procedure has been removed.
* The %EXIT procedure has been renamed to EXIT.
* The EMERGENCY-EXIT procedure has been added.
* The optional argument to the above has been generalized to meet R7RS
requirements.
* The QUIT procedure has been renamed to SUSPEND to more accurately reflect what
it does.
* The names %EXIT and QUIT are deprecated aliases for EXIT and SUSPEND.
Chris Hanson [Sun, 13 May 2018 23:05:37 +0000 (16:05 -0700)]
Don't expose internal structure of continuations.
Chris Hanson [Sun, 13 May 2018 06:22:28 +0000 (23:22 -0700)]
Eliminate two unused exports.
Chris Hanson [Sun, 13 May 2018 06:19:18 +0000 (23:19 -0700)]
Eliminate uses of unparser/set-tagged-{pair,vector}-unparser!.
Also change their implementation to use define-print-method.
Chris Hanson [Sun, 13 May 2018 06:18:05 +0000 (23:18 -0700)]
Rename a bunch of places from "unparse" to "print".
Chris Hanson [Sun, 13 May 2018 06:15:36 +0000 (23:15 -0700)]
Eliminate other references to "unparser" in the documentation.
Chris Hanson [Sun, 13 May 2018 05:33:03 +0000 (22:33 -0700)]
Simplify *print-with-brackets a bit.
Chris Hanson [Sun, 13 May 2018 05:32:36 +0000 (22:32 -0700)]
Assume that named vector/list unparsers are in fact print methods.
Chris Hanson [Sun, 13 May 2018 05:30:48 +0000 (22:30 -0700)]
Clean up printer bindings.
Chris Hanson [Sun, 13 May 2018 05:30:12 +0000 (22:30 -0700)]
Change "unparser" to "printer" in number printer.
Chris Hanson [Sun, 13 May 2018 04:36:32 +0000 (21:36 -0700)]
Update document to reflect new print-method implementation.
Chris Hanson [Sun, 13 May 2018 04:23:21 +0000 (21:23 -0700)]
Major refactor to how printer methods work.
* Replaced define-unparser-method with define-print-method. A print method is
an ordinary procedure that accepts an object and an output port as its
arguments and prints whatever it wants to. The translation layer required by
older unparser methods is no longer needed.
* New standard-print-method is roughly equivalent to simple-unparser-method.
* New bracketed-print-method is roughly equivalent to standard-unparser-method.
* Changed the printer to handle standard-print-method specially when detecting
cycles and shared structure, so that an object using that print method has its
parts walked when looking for shared/cyclic structure.
Chris Hanson [Sat, 12 May 2018 06:20:31 +0000 (23:20 -0700)]
Implement R7RS write procedures with datum labels.
For now, write and write-shared do the same thing. Limiting the labeling to
circularities is harder than doing all sharing, and unless I can find some new
algorithms, it is slower too. So write will generate more datum labels than
strictly necessary, but it is safe for printing circular structures.
Chris Hanson [Sat, 12 May 2018 06:20:14 +0000 (23:20 -0700)]
Remove unneeded environment arguments from various printers.
Chris Hanson [Sat, 12 May 2018 04:11:25 +0000 (21:11 -0700)]
Eliminate optional environment arg to write/display/etc.
Also eliminate output-port/write-object and make-unparser-state.
Chris Hanson [Thu, 10 May 2018 06:08:35 +0000 (23:08 -0700)]
Big refactor: rename parser/unparser to reader/printer.
Updated all references and left a couple of renames in place for documented
functionality.
Chris Hanson [Wed, 9 May 2018 05:03:23 +0000 (22:03 -0700)]
Implement console-error-port and initialize current-error-port to it.
Chris Hanson [Wed, 9 May 2018 04:59:47 +0000 (21:59 -0700)]
Implement current-error-port.
Chris Hanson [Wed, 9 May 2018 04:58:35 +0000 (21:58 -0700)]
Implement tty-error-channel and export to console I/O.
Chris Hanson [Wed, 9 May 2018 04:56:42 +0000 (21:56 -0700)]
Implement replace-binary-port! on generic I/O ports.
Chris Hanson [Wed, 9 May 2018 04:54:21 +0000 (21:54 -0700)]
Provide access to the channels in a binary port.
Chris Hanson [Wed, 9 May 2018 04:50:15 +0000 (21:50 -0700)]
Simplify console port exports.
* Eliminate console-input-port, console-output-port, and set-console-i/o-port!.
* Change console-i/o-port to be a thunk that returns the port.
Chris Hanson [Wed, 9 May 2018 04:45:21 +0000 (21:45 -0700)]
Implement support for stderr.
Chris Hanson [Tue, 8 May 2018 05:08:19 +0000 (22:08 -0700)]
Implement R7RS exceptions.
Chris Hanson [Tue, 8 May 2018 05:08:01 +0000 (22:08 -0700)]
Fix typo in previous change.
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 [Thu, 3 May 2018 06:15:02 +0000 (23:15 -0700)]
Add support for parsing nan.0, +inf.0, and -inf.0.
Not sure if nan.0 is meaningful, but it shouldn't do any harm.
Chris Hanson [Thu, 3 May 2018 06:08:03 +0000 (23:08 -0700)]
Update to reflect changes in runtime system.
Chris Hanson [Thu, 3 May 2018 06:07:46 +0000 (23:07 -0700)]
Add procedures to generate infinities and a nan.
Chris Hanson [Thu, 3 May 2018 05:52:12 +0000 (22:52 -0700)]
Don't constant-fold an application if it generates an error.
Also fix overlong lines and pages in object.scm.
Chris Hanson [Wed, 2 May 2018 06:45:02 +0000 (23:45 -0700)]
Implement finite?, infinite?, and nan? from R7RS.
Chris Hanson [Wed, 2 May 2018 06:42:45 +0000 (23:42 -0700)]
Fix typo in previous edit.
Chris Hanson [Wed, 2 May 2018 06:36:10 +0000 (23:36 -0700)]
Change rational? to be false for inf/nan.
Chris Hanson [Wed, 2 May 2018 06:35:32 +0000 (23:35 -0700)]
Change printed representation of inf/nan to match R7RS.
Chris Hanson [Wed, 2 May 2018 06:27:57 +0000 (23:27 -0700)]
Add support for C99 floating-point predicates.
Also expose those predicates in Scheme, and implement flo:eqv? properly.
Chris Hanson [Tue, 1 May 2018 06:52:22 +0000 (23:52 -0700)]
Update documentation of booleans.
Chris Hanson [Tue, 1 May 2018 06:48:06 +0000 (23:48 -0700)]
Generalize boolean=? to support multiple arguments.
Chris Hanson [Tue, 1 May 2018 06:26:24 +0000 (23:26 -0700)]
Tweak char and string chapters to be closer to R7RS.
Chris Hanson [Mon, 30 Apr 2018 18:59:57 +0000 (11:59 -0700)]
Eliminate bundle types; original design using predicates is better.
Chris Hanson [Mon, 30 Apr 2018 18:14:36 +0000 (11:14 -0700)]
Convert object hasher to be a bundle.
Chris Hanson [Mon, 30 Apr 2018 17:55:24 +0000 (10:55 -0700)]
Fix thinko as reported by Patric Jonsson.
Incorrectly computed length of result in exact-nonnegative-integer->bytevector.
Chris Hanson [Sun, 29 Apr 2018 22:57:51 +0000 (15:57 -0700)]
Convert metadata tables to be bundles.
Chris Hanson [Sun, 29 Apr 2018 22:50:11 +0000 (15:50 -0700)]
Initialize applicable records much earlier in the cold load.
Chris Hanson [Sun, 29 Apr 2018 21:49:59 +0000 (14:49 -0700)]
Clean up bundle implementation.
Chris Hanson [Sun, 29 Apr 2018 05:41:08 +0000 (22:41 -0700)]
Revert bundle abstraction back to what we are using the in the book.
The previous version didn't really do what I wanted and this one is useful in a
more limited context.
Chris Hanson [Sun, 29 Apr 2018 05:40:42 +0000 (22:40 -0700)]
Fix typo: accidentally discarded initialization in earlier change.
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 [Sun, 29 Apr 2018 03:50:25 +0000 (20:50 -0700)]
Add adapter for hash-object.
Chris Hanson [Sat, 28 Apr 2018 23:56:14 +0000 (16:56 -0700)]
Implement symbol=? for R7RS.
Also fix some symbol procedures that were unsafe.
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 [Fri, 27 Apr 2018 05:37:04 +0000 (22:37 -0700)]
Deprecate with-values.
Chris Hanson [Fri, 27 Apr 2018 04:51:27 +0000 (21:51 -0700)]
Rename urtrap.scm -> reference-trap.scm.
Chris Hanson [Fri, 27 Apr 2018 04:47:59 +0000 (21:47 -0700)]
Export scode-expression?.
Chris Hanson [Thu, 26 Apr 2018 07:03:07 +0000 (00:03 -0700)]
Eliminate now-deprecated references to hash-table procedures.
Chris Hanson [Thu, 26 Apr 2018 06:48:49 +0000 (23:48 -0700)]
Update hash-table documentation in the reference manual.
Chris Hanson [Thu, 26 Apr 2018 06:48:22 +0000 (23:48 -0700)]
Mark all of the hash-table renames as deprecated.
Chris Hanson [Thu, 26 Apr 2018 06:21:44 +0000 (23:21 -0700)]
Rename hash-table-entry-type:key{/,&}datum-weak.
This makes it consistent with the ephemeron naming.
Chris Hanson [Thu, 26 Apr 2018 06:18:24 +0000 (23:18 -0700)]
Fix missed reference.
Chris Hanson [Wed, 25 Apr 2018 05:56:12 +0000 (22:56 -0700)]
Rewrite the object hashing facility.
* Names have been changed to avoid conflicts with hash tables, and for
consistency. The old names are still available as deprecated renames.
* New implementation is much easier to read.
Chris Hanson [Wed, 25 Apr 2018 05:55:42 +0000 (22:55 -0700)]
Add type and constructors for datum-weak hash tables.
Chris Hanson [Wed, 25 Apr 2018 05:42:41 +0000 (22:42 -0700)]
Fix typo.
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 [Tue, 24 Apr 2018 06:19:40 +0000 (23:19 -0700)]
Rename set-equality-predicate-hasher! -> set-equality-predicate-properties!.
Now has two required arguments: hash-function and rehash-after-gc?.
A rest argument is a keyword list for additional properties.
Chris Hanson [Tue, 24 Apr 2018 06:16:18 +0000 (23:16 -0700)]
Change keyword-option-parser to expect defaults as a thunk.
Chris Hanson [Tue, 24 Apr 2018 06:15:45 +0000 (23:15 -0700)]
Move int:modulo to primitive-arithmetic and export it.
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 [Sun, 22 Apr 2018 06:28:35 +0000 (23:28 -0700)]
Make sure that run-three-stages looks at "build" before "svm".
Chris Hanson [Sun, 22 Apr 2018 05:08:44 +0000 (22:08 -0700)]
Eliminate remaining uses of find-matching-item.
Chris Hanson [Sun, 22 Apr 2018 05:05:07 +0000 (22:05 -0700)]
Eliminate remaining uses of list-search-positive.
Chris Hanson [Sun, 22 Apr 2018 04:58:12 +0000 (21:58 -0700)]
Downcase remaining symbols in the runtime system.
Only remaining such symbols are those that have explicit case.
Chris Hanson [Sun, 22 Apr 2018 01:56:02 +0000 (18:56 -0700)]
Change SVM compiler to use new pop-return instruction.
Chris Hanson [Sat, 21 Apr 2018 06:45:42 +0000 (23:45 -0700)]
Implement new SVM instruction: (pop-return).
Chris Hanson [Thu, 19 Apr 2018 04:21:04 +0000 (21:21 -0700)]
Override definition of filter so that compilation using 9.2 works.
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 [Mon, 16 Apr 2018 02:16:38 +0000 (19:16 -0700)]
Change guarantee to show context of error.
Chris Hanson [Sun, 15 Apr 2018 08:29:19 +0000 (01:29 -0700)]
Eliminate references to now-deprecated definitions.