Matt Birkholz [Sat, 1 Oct 2022 20:16:33 +0000 (14:16 -0600)]
gdbm: Document the undocumented.
Export the documented gdbm_sync, gdbm_syncmode and gdbm_nolock flags.
Mention the ability to use symbols for flag arguments, rather than
constants like these.
Chris Hanson [Sun, 11 Sep 2022 06:10:46 +0000 (23:10 -0700)]
Provide uniform mechanism to for environment names.
Previously we called environment->package and used the name of the returned
package, if any. Now there is environment-name and some other procedures that
get the name, whether it's a package or a library.
Chris Hanson [Thu, 8 Sep 2022 07:56:02 +0000 (00:56 -0700)]
Allow multiple programs to be registered in a library DB.
Previously, a program was registered using its name -- #f -- which meant that
registering a second program would replace the first. Now, a unique key is
created for each program, and it is registered with that key.
Chris Hanson [Sun, 7 Aug 2022 04:49:58 +0000 (21:49 -0700)]
A bunch of changes to get things to config/compile on Ubuntu 22.04 LTS.
Many of these changes were due to autoconf 2.71, which has obsoleted a bunch of
the macros we were using, and whose advice has considerably changed as to what
macros are needed for reasonably modern systems.
The rest are changes to the C files that were affected by the autoconf changes.
rtlgen: Always copy register:value to temp in continuation.
This is necessary because register:value may be a machine register
available for allocation as a machine temporary (as on x86 where it
is rax).
I had found most (if not all) other cases where register:value needed
to be stashed in a pseudo temporary in a continuation, but I missed
this one: if the continuation is a predicate continuation that first
restores a dynamic link, the code to restore the dynamic link would
ask for a temporary register that might (and did) turn out to be the
same as register:value. Example:
This clobbers rax to restore the dynamic link, so the comparison at
the end compares compares the dynamic link, not the return value as
intended, to #f.
microcode: Fix bug in writing ucode stack traces to file.
In the v15 microcode merge, the type-abuse of casting a FILE * to
outf_channel was dropped, and thus so was the `C-c t' function's file
output at the console.
Do this is a slightly less abusive way that works with modern C and
modern platforms where enums are not necessarily wide enough, or
allowed by the semantics, to hold pointers.
Chris Hanson [Fri, 5 Nov 2021 06:02:38 +0000 (23:02 -0700)]
Rewrite datum label reading to support cyclical references.
This works fine in tests, but can't yet be used at the REPL. For example,
evaluating
'(a #1=(b . #1#))
goes into an infinite loop. This is because the quote syntax calls
strip-syntactic-closures, which doesn't handle circularity right. I'll rewrite
that soon.
Chris Hanson [Mon, 1 Nov 2021 06:17:02 +0000 (23:17 -0700)]
Fix handling of dot token in reader.
The reader was allowing the dot token to appear in places where it is illegal.
For example, it could be used in vectors, where it was treated as a symbol,
which is explicitly forbidden by R7RS.
I changed the reader to never convert the dot token to a symbol, and to only be
allowed in the list-parsing context. This revealed that there was an instance
of a quoted dot in another file, which again is forbidden.
This change may break any code that depends on dot being a symbol.
Chris Hanson [Mon, 12 Apr 2021 05:03:47 +0000 (22:03 -0700)]
Fix wastefulness in grapheme/word breaks.
The solution has two parts: the first part is to generate the transitions at a
finer grain and using hash consing for new states. The second part is to
optimize the resulting diagram by collapsing identical states, which are an
unfortunate side effect of the first part.
The end result is a much smaller diagram, in which there is never more than one
speculative branch introduced for any input code. I haven't measured the
performance, but this can't help but be faster just on the basis of the amount
of data being manipulated. Now that we have a limit on the speculative
branches, it should be possible to optimize the NFA further by supporting at
most two branches rather than a list of them.
Chris Hanson [Tue, 16 Mar 2021 05:05:25 +0000 (22:05 -0700)]
Implement grapheme/word-break changes for UCD 13.
This is a complete reimplementation of the segmentation code, since the old
model wasn't able to cope with the recent changes. There are a couple of
problems remaining:
1. The evolver interface was designed to do incremental generation of breaks.
The new design doesn't permit that, since it implements an NFA with speculative
branches. It could be changed to do the breaks in batches when speculations
collapse into certainties, but it is certainly simpler to accept all the breaks
at once.
2. The speculative branches are somewhat wasteful: many of them have identical
prefixes, which means we're updating several branches in parallel rather than
having a shared prefix and splitting branches only when necessary. I'm working
on an optimization that will take care of this.
Chris Hanson [Sat, 6 Mar 2021 21:49:44 +0000 (13:49 -0800)]
Add parameter to force printer to use ASCII.
This is needed for the UCD converter, when converting newer versions of UCD.
Otherwise the output could contain characters that can't be read by the host
Scheme reader, since they didn't exist in that version.