Includes the addition of 'overflow and 'start-overflow-work
events, whcih are effectively specializations of 'sync and
'start-work to expose overflow handling.
Also, fix a bug related to a potential GC during mark-stack
restore from a lightweight continuation.
Added alises for call-with-continuation-prompt,
abort-current-continuation, and call-with-composable-continuation.
Also allow % and fcontrol to take an optional prompt tag argument.
The new predicates are `progress-evt?' `thread-cell-values?',
`prefab-key?', `semaphore-peek-evt?', and `channel-put-evt?'.
These were used internally, and now they appear in contract
error messages.
When supplying an accessor to redirect, either the corresponding field
must be accessible through the current inspector, or a mutator for
the same field must be redirected, too.
Stevie realized that we need this constraint; otherwise, impersonators
can implement mutator-like behavior even when the mutator is otherwise
secret.
Add `raise-argument-error', `raise-result-error', `raise-arguments-error',
and `raise-range-error'.
The old convention was designed for reporting on a single (sometimes very
long line). The new convention is
<name>: <short message>
<field>: <detail>
...
If <detail> is long or itself spans multiple lines, then it may
also use the form
<field>:
<detail>
where each line of <detail> is indented by 3 spaces.
Backtrace information is shown as a multi-line "context" field.
The text that says that (regexp-split #rx"whatever" "") returns '("")
rather than '() is
If `input' contains no matches [...] the result is a list containing
input’s content [...] as a single element.
This is a little implicit, if you consider such an input as having
nothing left to match over so it's as if there is no input (with a port
this confusion is a little clearer).
Clarify with an example in the docs, and also add tests.
Various repairs --- especially to avoid duplicated prose.
Instead of
@(define explain @t{Long explanation about X...})
@defproc[(a ....) ....]{ .... @|explain| }
@defproc[(b ....) ....]{ .... @|explain| }
@defproc[(c ....) ....]{ .... @|explain| }
write
@defproc[(a ....) ....]{ .... Long explanation about X ... }
@defproc[(b ....) ....]{ .... X is like @racket[a]. }
@defproc[(c ....) ....]{ .... X is like @racket[a]. }
Otherwise, a reader is forced to reverse-engineer the
abstraction underlying `a', `b', and `c'.
The properties appear in the inlining expansion of an application
of a keyword-accepting function, and they're mainly intended for
use by Typed Racket.
The property keys are hidden, so that the property value can be
trusted as originating from `racket/base'. The accessor functions are
`syntax-procedure-alias-property' and
`syntax-procedure-converted-arguments-property' from
`racket/keyword-transform'.
In consultation with Ryan. We'd prefer to have versions of all
useful things in a `racket/...' library that is consistent as
possible with Racket forms and conventions.
This reverts commit f3b687c8ed.
After discussion with Robby and Stevie, we concluded that
this procedure isn't necessary for now. If we ever think
of more examples where it's useful we can bring it back.
a chaperone contract", "no it definitely isn't" or "evaluate this code
at runtime to find out"; previously only the first two options
were available to opters
(this commit also includes other tweaks here and there so won't stand alone)
These primitives atomically update a box to a new value, as long
as the current value is the same as a provided value. They also
are future-safe.
When futures are enabled, they use low-level hardware instructions
to perform the change atomically.
The example relied on the current code inspector affecting
syntax object created during `eval', but since the switch
from certificates to taints, the relevant code inspector is
determined by the namespace, and a namespace gets its code
inspector at creation time.
Closes PR 12717
The preserved path is exposed by a new `module-path-index-submodule'
function, and `module-path-index-join' now accepts an optional
submodule path.
Also, fixed a problem with `collapse-module-path-index' when
a module path indx is built on a resolved module path that
is a submodule path.
In addition to the main repair, `collapse-module-path[-index]' is
correctly documented to allow '(quote <sym>) rel-to paths.
Finally, `collapse-module-path-index' changed to use a symbolic
resolved module path that appears as the base of a module path
index, rather than falling back to the given rel-to path. It's
possble that the old beavior was intentional, but it wasn't tested,
and it seems more likely to have been a bug.
Closes PR 12724
library (mostly in opt/c)
Specifically:
- add inlining declaration for ->i helper function
- modernized the opt/c contracts and improved them so that mutually
recursive define-opt/c functions recognize each other instead of
bailing out to the slow path.
- added =/c as an optimized contract
- improve the error message for the between and comparison opt
contracts
- adjust the blame struct so the name is created lazily, since opt/c
contracts just stick a copy o the contract into the thunk that
creates the name and we don't want to run those effects twice if we
can help it.
adjust 'one-of/c' and 'symbols' so they just use or/c (when possible)
improve or/c's stronger check so that, in the case that or/c is
getting eq or equal contracts, or/c's stronger check is as good as
'symbols'/'one-of/c's stronger check is.
Although th eoriginal idea was to distinguish "text" paths
from derived filesystem paths, practically everythign that accepts
a module path also accepts a path. Building the generalization into
`module-path?' makes it easier to support `submod' wrappers on paths,
and it seems to fix things rather than break them.
Previously, sandbox creation used `gui?', which is the result of
`gui-available?' at the time that `racket/sandbox' is instanited.
This change makes sandbox behavior less sensitive tothe order in
which modules `require'd into a program are intiantiated.
The change depends on a new `sandbox-make-namespace' default
function for `sandbox-namespace-specs'. The new function uses
either `make-base-namespace' or `make-gui-namespace', depending
on whether the GUI library is available at that point.
A new `sandbox-gui-enabled' parameter can disable use of the
GUI library even if it is available.
The `gui?' binding is still exported for backward compatibility,
but it shouldn't be used anymore.
This addition triggered several other changes:
* -k for a Mac OS X embedding is now relative to the __PLTSCHEME
segment (which means that executables won't break if you strip
them, for example)
* the command-line no longer has a limited size for Mac OS X
launchers and embedding executables
* Mac OS X GUI and Windows launchers record the creation-time
collection path, unless they are created as "relative" launchers
In particular, allow a pair of a relative-to directory and a base
directory. Paths that syntactically extend the base directory are
recorded as relative to the relative-to directory (which must
syntactically extend the base directory).
The compilation manager now sets the parameter to a pair with
the base directory as the main collection directory, if the source
file's path extends that directory's path.
This generalization solves problems created by cross-module inlining,
where the source location of a procedure in bytecode can now be in a
different file than the enclosing module's file.
Also add a test that checks whether the build directory shows up
in any ".zo", ".dep", or documentation ".html" files.
Closes PR 12549
Setting the environment variable causes the bytecode compiler to run
the bytecode validator (which is normally applied to input from a
bytecode file) immediately on all of the compiler's own results.
The two became tangled in commit f7c16fc8, and then 952ae06105
adjusted the tangling in a way that broke code. This commit
further adjusts tangling in a way that hopefully causes fewer
compatibility problems, but it also splits inputs to
`make-evaluator' so that a programmer can choose more explicitly.
Rename `read-intern-literal' to `datum-intern-literal'.
Interning is needed only in `read-syntax' or `datum->syntax' to
set up the invariants that the bytecode compiler needs for cross-module
optimization. When `read'ing numbers from a data file, meanwhile,
interning slows things down a lot and doesn't seem worthwhile.
change the implementation to special case struct procedures and to use
it in provide/contract.
This speeds up the rendering phase of the Guide documentation by more than 2x.
Thanks to Matthew for spotting the opportunity!
It now creates an inspector based on the original code inspector instead
of the (implicit) wrong default used by `make-inspector'. Change
`sandbox-make-inspector' too, to make it explicit.
Fix memory accounting to detect when messages pile up in a
place channel and when shared values (such as the result of
`make-shared-bytes') pile up. Also fix problems where a GC
or free-page purge needs to be triggered.
The implementation causes a minor API change, which is that
a place channel sent multiple times as a message generates
values that are `equal?' but no longer eq?'.
Closes PR 12273
[Do not merge to 5.2]
Show process time of start of GC and otherwise adjust to make
the output more compact, and attach a prefab struct to the
logged message to report all available data in Racket form
(including real start and end times, which are not shown in
the output).
The `date*' structure type is an extension of `date' with
`nanosecond' and `time-zone-name' fields.
The `seconds->date' function now accepts a real and returns a
`date*'. The fractional part of its argument goes into the
`nanosecond' field.
Macros and other tools that need syntax privilege used
`(current-code-inspector)' at the module top-level to try to
capture the right code inspector at load time. It's more
consistent to instead use the enclosing module's declaration-time
inspector, and `var-ref->mod-decl-insp' provides that. The
new function works only on references to anonymous variables,
which limits access to the inspector.
The real function name is longer, of course.
The clarification mostly repeats information in the contract,
and we normally avoid that, but the bindings look undocumented
otherwise.
Closes PR 12162
For example,
(define-for-syntax (f x) (g x))
(define-for-syntax (g y) y)
is now allowed. The unbound-variable check for phase 1
and up is delayed until after the module body is partially expanded.
* When `accept-lang?' is #t turn the reader flag on, but otherwise don't
change it
* turn on the `read-accept-reader' flag which is needed after all
* two refactoring typos
* some more reformatting
Shared locking now allowed only on input port, and exclusive
locking is allowed only on output ports, which allows an implementation
via fcntl(...,F_SETLK,...).
Since sets are implemented using the elements as the domain of a hash table,
the following must be true:
* element contracts for (seteq ...) must be flat
* element contracts for (seteqv ...) must be flat
* element contracts for (set ...) must be chaperones, and the resulting
contract is a chaperone contract
Also, change higher-order set/c contracts to be chaperone contracts
due to the new restrictions.
requiring itself into the entered namespace.
This makes it useful in some cases where this require leads to a
dependency cycle, eg (enter! racket/list). It's obviously not useful
for use as-is, since you will not have a bound `enter!' to get out of
the namespace (and possibly no `require' to get it) -- but it is useful
for meta-tools like xrepl. This is why the flag is verbose. `xrepl'
now uses this flag.
Also, the check for valid keywords for the form is now done at runtime
rather than in the macro. This doesn't matter in this case, since the
form is intended for interactive use anyway.
Also, separate the two parts of `enter-load/use-compiled' (it was
defined curried, but didn't use it).
Use the new functions in `syntax-case'; the benefit is small, and
it's mostly useful as hint to the optimizer that the operation
can be dropped if the result isn't used