Commit Graph

38480 Commits

Author SHA1 Message Date
Robby Findler
31a9414983 move contract tests into contract subdirectory
and fix up the code that orders the tests when running them all
2016-01-05 09:41:47 -06:00
Robby Findler
c7726e23ec fix random-generation for and/c 2016-01-05 09:14:15 -06:00
Robby Findler
3f4dcb8e87 more accurate error message when content-length is missing 2016-01-05 09:09:52 -06:00
Robby Findler
3df12dca58 specialize sequence/c for one-element sequences
this yields only a modest speed up and only when iterating
over long sequences, e.g. like in this program:

  #lang racket/base
  (require racket/sequence racket/contract/base)
  (define s (make-string 10000 #\a))
  (define str (contract (any/c . -> .  (sequence/c char?))
                        (λ (x) (in-string s))
                        'pos 'neg))
  (time
   (for ([x (in-range 100)])
     (for ([x (str 0)])
       (void))))
2016-01-04 19:56:46 -06:00
Robby Findler
94ac77d30e port sequence/c to late-neg projections 2016-01-04 19:56:45 -06:00
Robby Findler
3ed7dfd62b add the contract printer to set contracts 2016-01-04 19:56:45 -06:00
Robby Findler
14b951cf44 improve the performance of the way contract-stronger? recurs
and fix evt/c's contract-stronger
2016-01-04 19:56:45 -06:00
Matthew Flatt
d37ee8c5b1 fix place and raco exe
The repair involves making `raco exe` detect a sub-submodule
whose name is `declare-preserve-for-embedding` as an indication
that a submodule should be carried along with its enclosing module.

Normally, `define-runtime-module-path-index` would do that, but
the submodule for `place` is created with `syntax-local-lift-module`,
and the point of `syntax-local-lift-module` is to work in a
nested experssion context where definitions cannot be lifted
to the enclosing module.
2016-01-04 11:01:48 -07:00
Matthew Flatt
73a010841f add raco exe test with place 2016-01-04 10:59:17 -07:00
Sam Tobin-Hochstadt
5cf748d734 Fix set chaperone tests.
`set-first` just does an extract, not a remove.
2016-01-04 11:08:02 -05:00
Robby Findler
1c431e6f4d Clean up chaperone-hash-set and impersonate-hash-set and adjust set/c to match
Made the hash-set chaperones essentially forward the hash chaperone
operations, but now explain them all in terms of set-based operations
in the docs.

Also adjusted value-blame and has-blame? to support late-neg projections
2016-01-03 20:43:24 -06:00
Robby Findler
77a76a7953 fix opt/c for the new way (-> any/c ... any) works
should have been a part of 36b3493e
2016-01-03 20:43:24 -06:00
Sam Tobin-Hochstadt
5ae4e45340 Merge pull request #1184 from andmkent/patch-3
more *syntax/loc for match forms
2016-01-03 17:02:03 -05:00
Vincent St-Amour
cc79e2241c random: Get the right name without run-time overhead. 2016-01-03 13:53:31 -06:00
Vincent St-Amour
4509430063 Fix object name for new random function. 2016-01-03 13:05:35 -06:00
Vincent St-Amour
1e18a7e2b4 sequence-length: special-case lists too. 2016-01-03 13:05:35 -06:00
Matthew Flatt
a2c9b47552 Merge pull request #1189 from LeifAndersen/fix-zo-docs
Fixed typo in zo docs.
2016-01-03 06:47:48 -07:00
Matthew Flatt
d60185045c compiler/zo-marshal: enable marshal of top-level require 2016-01-03 06:44:07 -07:00
Matthew Flatt
423feb1e21 fix unmarshal of top-level "root" scope
Closes #9
2016-01-03 06:40:41 -07:00
Leif Andersen
2aa9d8cca3 Fixed typo in zo docs. 2016-01-02 23:07:31 -07:00
Vincent St-Amour
c47c0ebfca sequence-length: special case O(1) cases. 2016-01-02 20:05:04 -06:00
Vincent St-Amour
47f06f11e1 random: encourage inlining.
Reduces overhead to 6% over #%kernel's  for the integer case.
2016-01-02 20:02:30 -06:00
Vincent St-Amour
740b6dc198 random: Remove redundant checking. 2016-01-02 20:02:30 -06:00
Vincent St-Amour
acb7d999ba Comment typo.
Pointed out by Gustavo.
2016-01-02 20:02:30 -06:00
Vincent St-Amour
707f9bffa6 random: move sequence support to random-ref, in racket/random.
And add `random-sample`.
2016-01-02 20:02:30 -06:00
Vincent St-Amour
6af2f711b7 Fix optimization tests. 2016-01-02 20:02:30 -06:00
Vincent St-Amour
0796350a88 Extend random to work with ranges and sequences.
Requested by Matthias.
2016-01-02 20:02:30 -06:00
Robby Findler
36b3493e45 Change contracts of the form (-> any/c ... any) to not be flat contracts
The issue is what happens when the actual function has other arities.
For example, if the function were (λ (x [y 1]) y) then it is not okay
to simply check if procedure-arity-includes? of 1 is true (what the
code used to do) because then when the function is applied to 2
arguments, the call won't fail like it should. It is possible to check
and reject functions that don't have exactly the right arity, but if
the contract were (-> string? any), then the function would have been
allowed and only when the extra argument is supplied would the error
occur. So, this commit makes it so that (-> any/c any) is like
(-> string? any), but with the optimization that if the procedure
accepts only one argument, then no wrapper is created.

This is a backwards incompatible change because it used to be the
case that (flat-contract? (-> any)) returned #t and it now returns #f.
2016-01-02 17:29:58 -06:00
Matthew Flatt
fdf56dfebf fix calculation of unexported bindings
When a module defines <name-1> and doesn't export it, but when
the module imports <name-2> and re-exports that refers to another
module's definition of <name-1>, then <name-1> wasn't properly
registered as an unexported binding.

Most of the implementation change is just a clean-up of an
unnecessary traversal from before the addition of a `count`
field in each hash table.
2016-01-02 15:10:23 -07:00
Matthew Flatt
190925ee32 avoid a compiler warning 2016-01-02 07:46:42 -07:00
Robby Findler
2529e63b74 make stronger recognize any/c on the right as stronger than any flat contracts 2016-01-01 19:49:38 -06:00
Robby Findler
b24882fd18 implement the (-> any/c ... any) special case for the new -> contract combinator
(new is being used in a relative sense here; it is the newer of the
two -> combinators; the old one is used currently only for ->m)
2016-01-01 19:49:38 -06:00
Matthew Flatt
fd7b8b29ea avoid compiler warning 2016-01-01 14:33:16 -07:00
Matthew Flatt
c0915b02b0 pathlist-closure, tar, and tar-gzip: add #:path-filter
Also, add `#:skip-filtered-directory?` to `find-files`.

Less significantly, adjust `pathlist-closure` to be consistent in the
way that it includes a separator at the end of a directory path.
2016-01-01 13:52:37 -07:00
Matthew Flatt
c9a1dc781e raco setup: use lazy ".zo" parsing for dpeendency checking
Lazy ".zo" parsing make the dependency check take about half as
long.
2016-01-01 13:52:37 -07:00
Matthew Flatt
d3bb9d0412 fix bytecode-reading time-complexity bug
When a tree marshaled to bytecode form has many shared pieces,
the unmarshaling process can lose track of the sharing in one
place and traverse too much of the structure as pieces are
loaded.
2016-01-01 13:52:37 -07:00
Matthew Flatt
8b7f5bc046 faster xexpr->string 2016-01-01 13:52:37 -07:00
Vincent St-Amour
923b5864a5 Small guide fixes.
Closes PR 15109.
2016-01-01 12:52:14 -06:00
Vincent St-Amour
8c8a76979b Fix keyword argument name.
Closes PR 15089.
2016-01-01 12:52:14 -06:00
Vincent St-Amour
4c04d4afce Fix discussion of filter.
Closes PR 15083.
2016-01-01 12:52:14 -06:00
Robby Findler
110f1bd9b0 different, more likely fix 2015-12-31 15:36:33 -06:00
Robby Findler
357b692d33 fix typo 2015-12-31 15:33:59 -06:00
Matthew Flatt
567679bf0a {impersonate,chaperone}-hash: add equal-key-proc wrapper
The optional `equal-key-proc` wrapper effectively interposes on calls
to `equal?` and `equal-hash-code` for hash-table keys.
2015-12-31 09:22:57 -07:00
Andrew Kent
d5f61238c2 more *syntax/loc
I was using match-let and got a syntax error that pointed to this file. After changing the match-let definition to use syntax/loc the error pointed to the exact spot causing the problem. Yay!

I changed quite a few vanilla syntax-quotes to the *syntax/loc form... perhaps some do not need to? I'm not sure.

added back nested syntax/loc
2015-12-31 10:36:30 -05:00
Robby Findler
e92b8610f2 port id-set/c to late-neg 2015-12-30 19:16:36 -06:00
Robby Findler
85c781452d wording tweaks 2015-12-30 17:57:36 -06:00
Benjamin Greenman
0f7a946dba put contract-property accessors in an itemlist 2015-12-30 17:52:33 -06:00
Benjamin Greenman
61e21dba22 typo: is-flat-contract? -> is-list-contract? 2015-12-30 17:52:26 -06:00
Robby Findler
df382ca939 improve warnings and fix small problems with contract combinator constructors 2015-12-30 17:13:23 -06:00
Robby Findler
cb2af327e6 port async-channel/c to late-neg proj
and drop other projection implementations
(mostly to reduce the testing burden)
2015-12-30 17:13:22 -06:00