Two caveats:
* in some positions : is not accepted as a formal
when used in combination with * as a formal
* the quality of parse error messages for rest
argument types is traded for better optional argument
error messages
Instead of parsing the module's body like env-lang,
export a `type-environment` form instead. That way
the module may contain any auxiliary definitions
or expressions that are needed.
Additionally allow #:opaque and #:struct clauses
for opaque and struct types in the base type environment.
Update typed/syntax/stx for the new API.
This provides better inference for the case when trying
to infer a ListDots in a negative position against a List
type. For example, when trying to apply `time-apply`.
Instead of claiing "beginning of time" and an empty SHA1, use
`file-stamp-in-paths` to get a proper stamp.
This fixes a problem when installing built packages into user scope
where the built packages refers to an installation-scope library
and SHA1s need to be checked to fix up file timestamps.
A function like (lambda (x) (lambda (y) y)) would cause TR
to fail in an internal metafunction. The fault was triggered
when the object y is abstracted to (0 0) and then the outer
lambda tries to abstract (0 0) and fails.
The problem was triggered by the new path index changes in
v6.0 because TR did not previously try to abstract objects
that occurs in the target type (now necessary for scope
lifting of path indices), which may contain non-identifier
objects.
This error didn't occur in another nearly identical (except
for one crucial identifier? check) code path, so this commit
also eliminates the duplication by abstracting.
The "view" coordinate system for 2D plots used to be the same as the
"plot" coordinate system, except possibly stretched in a way that
preserved endpoints. When the endpoints were close to extreme flonum
values like +min.0 or +max.0, and the 2D plot area determined that
there were enough floating-point numbers within the plot bounds to do
fast floating-point arithmetic without losing visual fidelity, some of
that arithmetic could overflow. Then +inf.0 and +nan.0 values would
passed to `set-clipping-rect', which would promptly throw up, as it
should.
Solution: like the 3D plot area, use a normalized view coordinate
system. Now stretched plot coordinates are translated and scaled to
[0,1]x[0,1], for which floating-point arithmetic won't overflow.
Now, for example, (plot (density '(0))) works.
Calculated bandwidth is now bounded by both 1e-308, below which
`kde' produces nonsense, and 1e-14 * max absolute value. The latter
bound ensures the bandwidth is wide enough to make a smooth-looking
curve even in the presence of floating-point rounding in the domain,
by ensuring that at least 100 floating-point numbers or so in the
domain get nonzero density.
It's a little weird to use the gap between floating-point numbers
for this, but it ensures density estimates aren't jagged because
of rounding (at least until you zoom in, in some instances), and
it's at least a decent method of estimating bandwidth for single-
sample density estimators.