Commit Graph

38922 Commits

Author SHA1 Message Date
AlexKnauth
3996f23879 add src argument to syntax:read-xml
and pass it through into the syntax-source field of the result
2018-06-18 19:52:52 -04:00
Matthew Flatt
0cd640811b reference: use racket/private/kw-syntax-local as binding source
Using `racket/private/kw-syntax-local` as the source for
`local-expand`, etc., means that modules that re-export that
one (such as `scheme/base`) get the right documentation links.
2018-06-18 08:37:51 -06:00
Gustavo Massaccesi
9cd3798ca9 schemify: add reduction of (not #f) 2018-06-16 22:44:39 -03:00
Matthew Flatt
96161f68eb fix non-initial call to scheme_basic_env
When an embedding application calls `scheme_basic_env` a
second time, it's supposed to reset the main namespace, but
the new expander wasn't reset correctly.
2018-06-16 15:49:38 -06:00
Matthew Butterick
d2a69d6384
doc typos 2018-06-16 13:39:32 -07:00
Matthew Flatt
3c752e008e Racket HISTORY note for v7.0 2018-06-16 09:59:38 -06:00
Matthew Flatt
d3067465e3 setup/unixstyle-install: use delete-directory/files
Use `delete-directory/files` instead of a separate implementation
here to get the special deletion mode for Windows files.
2018-06-16 09:59:38 -06:00
Philip McGrath
5a4ea2cd1b json: small fixes
* Fix handling of single-percision infinities and nan

* Document that non-`hash-eq?` hash tables are accepted by `jsexpr?`.

* Document that the value of `json-null` is recognized using `eq?`

* Use `case` instead of `assoc`.

* Use contracts
2018-06-16 00:42:43 -04:00
Sam Tobin-Hochstadt
3b13cb899a "Fix" the packers.rkt test.
It appears that sometimes file timestamps can be off by 2, in
addition to the granularity-of-2-seconds issue.
2018-06-15 21:12:34 -04:00
Matthew Flatt
047157dc30 reference: doc repairs
Doc corrections related to functions that have new optional arguments
in v7.0.

Closes #2134
2018-06-15 17:19:42 -06:00
Alexis King
41fd4f3a5e Allow local-expand to opt-out of implicit extension of the stop list
Also, adjust the expansion of #%plain-module-begin to reinstate the stop
list after initial partial expansion.
2018-06-15 17:56:52 -05:00
Matthew Flatt
88e5daf65c add MemoryModule copyright to license page
Include the MemoryModulee copyright alongside the ones for other libraries
that are compiled into the Racket executable.
2018-06-15 16:43:30 -06:00
Oling Cat
331c39cfe9 The HtDP/2e is about Racket now. 2018-06-15 16:21:01 -06:00
Matthew Flatt
98ae91e0ba expander: repair and further improve flattener
Delay reporting of potential problems until an actual problem
is detected. Correct a mismatch between original and renamed
symbols to restore detection of problems.
2018-06-14 17:27:00 -06:00
Sam Tobin-Hochstadt
62ef3ed1ee Improve flattener. 2018-06-14 14:04:05 -06:00
Matthew Flatt
daa7ddeef8 workarounds for Windows filesystem behavior
* When you delete a file in Windows, then the name doesn't go away
  until the file is closed in all processes (and background tasks like
  search indexing may open files behind your back). Worse, attempting
  to create a new file with the same name reports a permission error,
  not a file-exists error; there's seems to be no way to tell whether
  a permission error was really a file-exists error.

  This creates trouble for `make-temporary-file` when files are
  created, deleted, and created again quickly enough and when
  something like a search indexer runs in the background (which is the
  usual Windows configuration). In practice, that kind of collision
  happens often for `raco setup` on my machine.

  To compensate, make `make-temporary-file` try up to 32 times on a
  permission error. A collision that many times seems extremely
  unlikely, and it seems ok to delay an actual permission error.

  Windows provides a GetTempFileName function from "kernel.dll" that
  must be able to deal with this somehow --- perhaps because it's in
  the kernel --- but it doesn't solve the problem for making temporary
  directories, hence the 32-tries approach for now.

* When a deleted file's name persists because the file is open in some
  process, then a directory containing the file cannot be deleted.

  This creates trouble for `delete-directory/files`, since
  `delete-file` on a directory's content doesn't necessarily make the
  directory empty. In practice, this happens often for package
  upgrades on my machine, where the package system wants to delete a
  short-lived working space that the indexer is trying to scan.

  To compenstate, change `delete-directory/files` to delete a file by
  first moving it to the temporary directory with a fresh name, and
  then delete the file there. It may take a while for a file to
  disappear from the temporary directory, but meanwhile it's not in
  the way of the original enclosing directory.

* When a file is open by any process, it prevents renaming any
  ancestor directory of the file.

  This creates trouble for the package system, which installs a
  package by unpacking it in a temporary place and then moving it by
  renaming. The package system also removes a package by renaming it
  to a subdirectory of a ".trash" directory. If a background indexer
  has a package file open, the move fails. In practice, a move fails
  often on my machine when I'm attempting to upgrade many packages.

  To compensate, make the package system fall back to copy + delete
  if moving fails with a permission error.
2018-06-13 18:57:07 -06:00
Matthew Flatt
09cdbc418c expander: allow rename transformer to primitive in local-expanded
Closes #2119
2018-06-12 19:19:09 -06:00
Matthew Flatt
c7318cab33 expander: fix syntax-local-bind-syntaxes for local-expand
Bind variables in a way that allows `local-expand` (with an empty stop
list) to replace a reference to the binding with one that has the same
scopes as the binding.
2018-06-12 16:23:44 -06:00
Matthew Flatt
380dc42427 expander: fix interaction of expand+eval across namespaces
This repair was motivated by tests in the "rex" package. The
new test added here failed before by finding 'new both times,
but in the "rex" case, the mixup led to the same variable
being imported and exported at the linklet level.
2018-06-12 12:58:56 -06:00
Ben Greenman
cf0c06d810 struct-out: get correct list of super-struct mutators
struct-out was putting the super-struct's accessors into two parts of a
struct-info: the accessor list and the mutator list

this commit puts the accessors only in the accessor list and the
mutators in the mutator list
2018-06-12 08:49:58 -06:00
Matthew Flatt
5c641919a6 fix --enable-jitframe for platforms that use libunwind 2018-06-11 18:16:17 -06:00
Matthew Flatt
0d870fb11c reader: fix bugs in cdot readering 2018-06-11 16:24:34 -06:00
Matthew Flatt
f11b4319b5 catch up on some acknowledgments 2018-06-11 11:42:18 -06:00
Matthew Flatt
a703b608a4 add --enable-jitframe for configure on x86_64
Using a frame pointer for the ABI of internal helper functions
should make the stack friendlier to tools like `perf`. There
may be a small performance cost, though.
2018-06-11 08:35:42 -06:00
Matthew Flatt
2c58937008 expander: fix comment 2018-06-08 09:24:13 +08:00
Vincent St-Amour
a2ab778ddb Post-release version for the v7.0 release 2018-06-07 09:10:05 -05:00
Robby Findler
aabd0e4603 fix random contract generation for </c and >/c when they get +inf.0 or -inf.0 2018-06-07 08:49:02 -05:00
Sam Tobin-Hochstadt
c6dd371ed6 Make stx.rkt cross-phase persistent.
This eliminates more than 70 linklet instance creations.
2018-06-07 09:38:38 -04:00
Matthew Butterick
ce97087507
missing paren 2018-06-06 14:44:40 -07:00
Sam Tobin-Hochstadt
2255d5be78 This require only needs racket/base. 2018-06-06 15:29:58 -04:00
nocheroot
fdc033474a Fix typos in test.rkt 2018-06-06 08:46:28 -03:00
Alexander McLin
5d1371cb73 Added clarifying notes emphasizing that dynamic-require is a procedure so
giving plain s-exps like you would for `require` is unlikely to work as expected.
Need use something that evaluates to the appropriate s-exp you want.

Added more examples of different `dynamic-require` uses.
2018-06-05 16:40:01 -04:00
Matthew Flatt
4e10ed0518 expander: fix another local-expand problem with 'module-begin
Alexis's repair, and as she notes, forcing a `post-expansion` context
value in the core `#%module-begin` expander may allow a simplification
in "definition-context.rkt". But it's not immediately obvious, so save
that potential improvement for later.

Relevant to #2118
2018-06-03 17:10:31 +08:00
Matthew Flatt
9ca8d34e7c expander: clean up post-expansion scope representation
Instead of three different fields in the context to keep in sync,
encode the possibilities witin a single field.
2018-06-03 16:46:46 +08:00
Matthew Flatt
a1b5bab31b expander: repair local-expand with definition context
When `local-expand` receives one or more internal definition contexts,
it would forget about any current post-expansion scopes. That's
particularly a problem in a 'module-begin expansion context, where the
post-expansion scope ensures that any bindings are suitably
phase-specific.

Closes #2115
2018-06-03 10:02:01 +08:00
Georges Dupéron
3fa6fef654 Use @racketmodname in the documentation of racket/unsafe/undefined (#2117) 2018-06-02 21:26:59 -04:00
Gustavo Massaccesi
b9392b2a51 use unsafe-undefined for missing arguments in string-join
This is similar to the recent change of functions with optional
values. Using unsafe-undefined instead of a gensym makes it easier
to avoid the check of the missing argument.
2018-06-01 16:33:16 -03:00
Gustavo Massaccesi
fd149ca1c0 fix cache of regexp in string-{split,trim,normalize-spaces}
When the separator is a string, these function construct a regexp
that is cached to make repeated calls faster. But when the string
is mutated it is necessary to recalculate the regexp.
2018-06-01 16:33:07 -03:00
Matthew Flatt
0ab9de2fb1 syntax-case docs: clarify grammar of "rest" patterns
The grammar constraint was specified in prose, but but in a way that
clearly covered both cases, and adjusting the grammar seems clearer.
2018-06-01 17:47:02 +08:00
Matthew Flatt
8d56c29317 expander: fix incorrect addition of shifts
Commit 32b256886e adds shifts in one place where it shoouldn't;
the "determinsitic-zo" test exposed the problem.

Also, avoid adding shifts that will have no effect, which avoids
accumulating useless shifts in some top-level contexts.
2018-06-01 07:41:26 +08:00
Matthew Flatt
2cfd65e972 defend against bad bytecode
Closes #2107
2018-06-01 07:41:25 +08:00
Philip McGrath
ba874ebe14 doc fix for chaperone-struct-type
The `guard-proc` argument must accept one more argument than the constructor for the chaperoned struct type, not the same number of arguments.
2018-05-31 10:38:04 -04:00
Ben Greenman
0f1ad7d232 doc: remove debug-scopes dependency 2018-05-31 09:36:51 -04:00
Matthew Flatt
937c396e1b expander: don't flip use-site scope in local-expand
Various parts of the expander, including `local-expand`, always
flipped the use-site scope when flipping an introduction scope. Onlt
`syntax-local-introduce` should flip both of them, though.

Closes #2112
2018-05-31 18:06:59 +08:00
Matthew Flatt
32b256886e expander: fix problem with module->namespace and shifts
When expanding in a namespace for a module unmarshaled from ".zo"
form, a scope corresponding to the module's "inside edge" is added to
every expansion. Before this repair, the scope was detached from
module path index shifts that might apply to the bindings (including
references to bulk bindings). Repair the problem by adding suitable
shifts when adding the scope.

Thanks to William Hatch for the bug report.
2018-05-31 18:06:58 +08:00
William J. Bowman
53f7a95dc2 Extended documentation for racket/trace for syntax transformers (#2076)
* Extended documentation for racket/trace for syntax transformers

* Assorted fixes due to feedback
2018-05-30 23:12:41 -04:00
Matthew Flatt
865efb7dda add and use racket/repl
As suggested by Sam: Using `racket/repl` to start a read-eval-print
loop can mean that less code is loaded if a startup language other
than `racket/base` is selected.

Closes #2064
2018-05-30 15:55:54 +08:00
Matthew Flatt
388345f35f fix eval variant used for command-line arguments
Closes #2111
2018-05-30 10:13:50 +08:00
Matthew Flatt
7bbbb8f063 namespace-syntax-introduce: fix bad phase shift
A `namespace-syntax-introduce` at a phase other than 0 could shift the
phase of introduced context by double the correct shift.

Relevant to #2099
2018-05-26 21:31:41 -06:00
Matthew Flatt
b1bf333523 expander: avoid excessive binding information in error messages 2018-05-26 20:29:07 -06:00