Commit Graph

39078 Commits

Author SHA1 Message Date
Ben Greenman
a539825dc9 fix: allow missing fields in object/c-common-fields-stronger?
Change `object/c-common-fields-stronger?` to only compare the fields
common to both objects.
2018-05-11 11:50:14 -04:00
Robby Findler
8ec3edaa95 add contract-equivalent?
and use it to get rid of the change in 4de050552,
avoiding the exponential blowup in a way that
doesn't compromise on contract-stronger?'s result
2018-05-09 21:32:29 -05:00
Matthew Flatt
c927a004d2 expander: fix problems with syntax-local-make-definition-context
Allow `syntax-local-make-definition-context` in places where the
created scope is not accumulated for stripping from `quote-syntax`.
Refine the docs to clarify those situtations.

A test for the repair exposed a problem with use-site scopes
and `quote-syntax`, so fix that, too.

Closes #2062
2018-05-06 20:23:39 -06:00
Matthew Flatt
f9821f9f15 variable-reference->namespace: repair namespace availability
Internally, the namespace must be set to the returned one while making
it available. Otherwise, the current namespace can get mangled.

Closes #2067
2018-05-06 20:23:39 -06:00
Robby Findler
76c404dffc fix contract-stronger bug 2018-05-06 21:21:44 -05:00
Matthew Flatt
f231cb2003 expander: fix problem related to (local-expand 'module-begin ...)
When `local-expand` is used for a 'module-begin context, use a fresh
binding -> definition-unreadable-symbol table for the nested
expansion. That way, the table used for the main expansion is
unchanged, and re-expanding or evaluating the expanded module will
arrive at the same unreadable symbols as the initial expansion.

The report and example are from Alexis.
2018-05-06 07:59:54 -06:00
Matthew Flatt
662a9022c0 refine implementation of keyword and optional arguments
The old implementation turns a single optional argument into two
arguments: the optional value and a boolean to indicate whether the
optional value is supplied.

The new expansion uses `unsafe-undefined` in place of not-supplied
arguments, in the general case. If the default-value expression is
simple enough, however, it is copied to call sites that would
otherwise supply `unsafe-undefined`. In the common case where the
default value is `#f`, for example, no run-time test is needed in the
core implementation function to check whether the default is supplied,
because a `#f` will be filled in for callers.

The performance improvement is tiny to non-existent for realistic
programs, but the simpler and reduced generated code may help in the
long run.
2018-05-06 07:59:54 -06:00
Robby Findler
4de0505525 block possible exponential explosion in stronger check 2018-05-06 08:58:21 -05:00
Asumu Takikawa
5eceb3d051 Guard FFI union functions with type checks (#1375)
* Guard FFI union functions with type checks

Also add unit tests for unions
2018-05-06 00:10:14 -04:00
Robby Findler
69eb5ee055 change the representation of blame objects
so that blame-swap (when no context is added)
is more efficient
2018-05-04 14:40:31 -05:00
Jasper Pilgrim
8d52373f5a Fix typo 2018-05-04 10:34:11 -05:00
Robby Findler
143d15eaa5 add the ability to not track context information in contract violation error messages 2018-05-04 06:38:59 -05:00
Jasper Pilgrim
ecae427777 Fix typo (#2063) 2018-05-03 10:08:47 -04:00
Robby Findler
3f4cbcbfd8 memoize the creation of the name in the blame object 2018-05-02 19:01:20 -05:00
Tucker DiNapoli
822938d9ae Handle symbol changes between openssl-1.0 and 1.1
In openssl-1.1 (specifically libcrypto) the functions sk_num, sk_value and sk_pop_free are prefixed by 'OPENSSL_'.
Now both symbol names looked for to support both version 1.0 and 1.1.
2018-05-02 06:26:08 -04:00
Sam Tobin-Hochstadt
73c3341001 Implement read-eval-print-loop using #%kernel.
Makes the repl faster to load when using a very small language
such as `racket/kernel/init`
2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
ba8c79f502 Avoid some dependencies for racket/kernel/init.
This is useful when loading without bytecode. Motivated by use in
Pycket, which does not load bytecode.
2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
409ad2d73b Avoid some uninitialized variables. 2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
3fc964faaf Fix name of the racket/private/top-int.rkt module. 2018-05-01 13:35:05 -04:00
Matthew Flatt
6f31650539 repair for re-expansion of an implicit-form expansion
The repair in 385f9588f8 propagates the
must-be-bound callback too far. It shouldn't be propagated anymore after
a non-rename transformer is applied.

Closes #2048
2018-04-30 21:05:09 -06:00
Matthew Flatt
53c1b5b1db fix generated makefile dependencies to work when a file is deleted 2018-04-30 19:57:22 -06:00
Robby Findler
ff588f93eb add contract-pos/neg-doubling and use it in various places 2018-04-29 21:50:32 -05:00
Alexis King
96b69d0366 Add interned scopes and make-interned-syntax-introducer 2018-04-27 20:12:11 -05:00
Robby Findler
8dbedc6a26 the commit 2a1c8a78 contained stuff that was meant to be in bff0c41
so when it was reverted, we have to bring back that stuff
2018-04-27 18:59:10 -05:00
Robby Findler
ef8101bde3 Revert "change the strategy for recursive-contract's knot tying"
This reverts commit 2a1c8a78a5.

something goes wrong with large recursive nests with this commit
2018-04-27 15:04:03 -05:00
Matthew Flatt
53ffd28e0f expander: atomic update of a module-path-index table
A module path index used to expand a module must be interned, and the
intern table is an `equal?`-based weak hash table, which means there's
an internal lock on the table that can be damaged if the current
thread is terminated while using the table.

I don't see an easy way to fall back to `eq?`-based tables, so I'm
resorting to an atomic region (which I had managed to avoid until
now).
2018-04-27 12:59:58 -06:00
Matthew Flatt
cb921cd1d9 configure: fix --disable-cify 2018-04-26 13:48:09 -06:00
Robby Findler
bff0c4113d lift out some work from object contracts from the post-value application
of the projection to the pre-value (after getting the blame object)
2018-04-26 14:30:58 -05:00
Robby Findler
2a1c8a78a5 change the strategy for recursive-contract's knot tying
this change speeds up this microbenchmark by about 10x:
2018-04-26 14:06:17 -05:00
Milo
026d368a38 Improve some errors from match and friends (close #1431, #1615) (#1974)
* More specific error for no-clause match-lambda** (close #1615)

* Remove unused orig-stx parameter from racket/match internals

* Use of match-XYZ/derived for better errors (fix #1431)

* Tests for the exceptions produced by racket/match
2018-04-25 17:17:39 -04:00
Matthew Flatt
bc55560f8d raco pkg update: add ---unclone as a kind of alias for --lookup
It's difficult to remember that the opposite of `--clone` is
effectively `--lookup`.
2018-04-25 09:54:06 -06:00
Alexis King
e2ef7cdd5c Make syntax-local-lift-require not affect syntax-original?-ness 2018-04-25 10:52:14 -05:00
Alexis King
b87793640b Add quote-syntax and #%plain-module-begin to kernel-form-identifier-list 2018-04-24 15:10:11 -05:00
Robby Findler
b8c398cc69 add obligations for instanceof/c 2018-04-24 14:48:11 -05:00
Matthew Flatt
77d0b0b8f4 syntax-local-lift...: correct error for module-begin context
Relevant to #2052
2018-04-24 08:22:37 -06:00
Matthew Flatt
88d8ba00e0 bytecode compiler: fix for call-with-immediate-continuation-mark
The converstion from calling `call-with-immediate-continuation-mark`
to an internal `with-immediate-continuation-mark` form did not handler
a mutable argument variable.
2018-04-23 21:13:10 -06:00
Alexis King
3531cb24f4 Restore binding-introduction behavior of parent definition contexts
This behavior was in Racket 6, but was not preserved in the new
expander.
2018-04-23 11:19:20 -05:00
Matthew Flatt
b1f9f2caad expander: no #%expression in fully expanded
Ensure that `#%expression` appears only around a top-level form in
a fully expanded form.
2018-04-22 08:15:44 -06:00
Alexis King
7d556d4006 Preserve some coercion behavior of old internal-definition-context-apply
mzlib/unit200 relies upon this behavior, even though it appears to have
been mostly accidental, so this maintains it for the sake of
backwards-compatibility.
2018-04-20 20:42:14 -05:00
Daniel Feltey
51decc085d remove unused definition 2018-04-20 17:00:25 -05:00
Matthew Flatt
07473865a6 fix continuation-mark splicing across composable combinations
Although splicing was set up for applying a composable
comtinuation to most kinds of continuations, it was not
set up right for applying a composable continaution in tail
position for a just-applied composable continuation.

Thanks to Spencer Florence for the report and example.
2018-04-20 12:02:59 -06:00
Alexis King
531c422652 reference: “is comprised of” → “comprises” 2018-04-20 12:26:21 -05:00
Alexis King
6834e4a12c Document and generalize some things for first-class definition contexts
This commit adds a section to the reference to document how the expander
tracks information about local bindings, and it extends some
syntax-local functions to allow them to accept multiple definition
contexts instead of just one. In addition, it improves the documentation
on how first-class definition contexts interact with local-expand,
syntax-local-value, and syntax-local-bind-syntaxes, and it also
clarifies what it means to create a child definition context.
2018-04-20 11:47:23 -05:00
Alexis King
e5b5747566 Make local-require work with phase shifted require specs
fixes #2049
2018-04-19 15:16:18 -05:00
Stephen Chang
5de19e593b
guide: a few more typos in instantiations and visits sec 2018-04-19 13:33:25 -04:00
Ben Greenman
25fbaad1ad guide: proofread section on instantiations and visits 2018-04-19 11:48:47 -04:00
Vincent St-Amour
becdd56ca8 Fix typoes in the visit module instantiation docs. 2018-04-18 11:07:46 -05:00
Matthew Flatt
65217898d1 repair gui native-lib metadata generation 2018-04-17 15:44:03 -06:00
Matthew Flatt
959a57d31f guide: add section on instantions and visits 2018-04-17 14:07:33 -06:00
Matthew Flatt
3b1ddc6ee4 update native-library notes for PPC Mac OS 2018-04-16 07:40:58 -06:00