Commit Graph

37827 Commits

Author SHA1 Message Date
Robby Findler
2febfb1dba declare that examples that raise errors raise errors 2017-03-07 18:59:44 -06:00
Robby Findler
3a639d7794 improve interaction between natural?, exact-positive-integer?, exact-integer?,
and/c, and between/c (which implies <=/c and >=/c) so that they turn
themselves into integer-in when appropriate

for example, (contract-stronger? (integer-in 0 4) (and/c natural? (<=/c 4)))
returns #t
2017-03-07 16:38:35 -06:00
Robby Findler
87e024d55c allow #f as arguments to integer-in 2017-03-07 16:27:18 -06:00
Robby Findler
7c3412957a add the same fast path to contract? and chaperone-contract? that is already in flat-contract? 2017-03-07 16:27:18 -06:00
Robby Findler
36368628af adjust -> expansion to make it more friendly to possible inlining 2017-03-07 16:27:17 -06:00
Benjamin Greenman
6e746891ef clarify error message for take and drop (#1582) 2017-03-06 18:45:09 -05:00
James Bornholt
b978631823 Clarify order of arguments for stream-fold (#1578) 2017-03-06 18:44:42 -05:00
Benjamin Greenman
d8b78e823e relax contract for (random min max [rand-gen]) (#1626)
Relax contract for `(random min max [rand-gen])` to accept any pair of
integers such that:
- `(< min max)`
- `(- max min)` is between 1 and 4294967087
2017-03-06 18:43:04 -05:00
Robby Findler
dbddb3785e add natural? to the known predicates with generators 2017-03-05 21:35:20 -06:00
Robby Findler
7bd7ec5aaf remove spurious } 2017-03-05 21:35:20 -06:00
Leif Andersen
1cbd75436b Eta expand natural?
Doing this eta expansion has the advantage that error messages
will point to `natural?` rather than `exact-nonnegative-integer?`
2017-03-03 09:58:19 -05:00
Leif Andersen
eca457e886 Add history for the following functions:
positive-integer?
negative-integer?
nonpositive-integer?
nonnegative-integer?
natural?
2017-03-03 09:29:57 -05:00
Matthew Flatt
1d61d9b752 add 'vm mode to system-type 2017-03-03 06:56:09 -07:00
Leif Andersen
1ebb3d5ef3 nonnegative-integer -> exact-nonnegative-integer 2017-03-02 19:24:12 -05:00
Leif Andersen
1ac2e77d00 Add natural? as an alias for nonnegative-integer? 2017-03-02 19:24:12 -05:00
Leif Andersen
c7df5f4150 And add tests 2017-03-02 19:24:12 -05:00
Leif Andersen
edf4bcfe78 Add documentation for the predicates in the previous commit 2017-03-02 19:24:12 -05:00
Leif Andersen
c911e4b52d Add the following predicates to racket/math:
- positive-integer?
- negative-integer?
- nonpositive-integer?
- nonnegative-integer?

These are like their exact-* counterparts provided by racket/base,
but they work for inexact numbers, and not just exact ones.
2017-03-02 19:24:12 -05:00
Matthew Flatt
d08a4cddfb fix stack-overflow handing lin the compiler's letrec-check pass
Closes #1621
2017-02-27 09:43:59 -07:00
Matthew Flatt
f19d655cbc fix optimizer bug related to single-use functions
Fix problem with once-use tracking and delayed variable-use marking
that is performed for local function bodies. A delayed variable-use
registration might happen after a once-used variable is replaced by
its use.

This scenario is difficult to provoke, because the optimizer has to
first decide not to move a once-use function, and in a latter pass
decide to move it after all. There's not enough information to
retract the tentative use plus its transitive implications.

The solution is to avoid the generic once-use layer for `lambda` forms
whose uses are delayed (and that likely has a good effect on inlining
anyway). The other half of the solution is to avoid transitive use
marking on a once-used variable whose expression has been moved (and
there are no transitive things to skip, because that expression isn't
a `lambda` form).
2017-02-26 08:58:36 -07:00
Matthew Flatt
a7ac75f15d use RTLD_LOCAL when loading extensions on Mac OS
It appears that Mac OS wants `RTLD_LOCAL` in the dlopen() call,
otherwise dlsym() searches through all previously open shared objects
– even though dlopen() is given a specific library handle.
2017-02-25 13:57:48 -07:00
Matthew Flatt
3c563484c6 fix memory-management bug in struct->vector
Closes PR 15410
2017-02-25 08:32:08 -07:00
Matthew Flatt
481dc9b0e8 fix port line, col, and pos to stay at #f when set to #f 2017-02-23 19:56:21 -07:00
Matthew Flatt
39b2a61700 fix mutability checking in impersonator-struct
Thanks to Scott Moore for the repair.
2017-02-23 19:56:21 -07:00
Ben Greenman
591d57b5bc typo: pluber? -> plumber? 2017-02-22 23:20:12 -05:00
Sam Caldwell
9f34be4b83 fix typo (#1620) 2017-02-17 21:54:37 +00:00
Andrew Kent
98b167d3a0 fix for/fold/derived examples
The previous for/fold/derived examples in the docs
incorrectly expanded, placing the entire body of the
user defined for loop into a let expression inside of
for/fold/derived. This meant that break clauses (i.e. #:break
or #:final) that appeared in the body of the user-defined
for loop were not visible to the underlying for/fold/derived
macro after expansion and therefore usages of #:break or #:final
incorrectly resulted in syntax errors (since with the incorrect
expansion, they were seemingly misplaced keywords inside of a let).

With this PR the for/fold/derived examples in the docs now
expand correctly into a form that mirrors the actual
expected syntax of for loops:

(user-defined-for (for-clause ...) body-or-break ... body)

==(now expands more or less into)==>

(for/fold/derived (for-clause ...) body-or-break ... body)

Or in other words, the body of the user defined for loop now correctly
expands directly into the body of for/fold/derived.
2017-02-17 06:32:25 -07:00
Leandro Facchinetti
ec5923a5c7 Fix typo in “INSTALL.txt” 2017-02-17 06:31:10 -07:00
Georges Dupéron
1c5747be98 Test for 69d7636 fix position counting with internal read shortcut (issue #1599) 2017-02-17 06:30:37 -07:00
Robby Findler
9098b39871 remove security mention that can be misconstrued 2017-02-15 13:58:51 -06:00
Jay McCarthy
fafa9c2bbd Merge pull request #1618 from leafac/fix-git-checkout
Fix “git-checkout”
2017-02-13 10:29:51 -05:00
Leandro Facchinetti
7ae83ba1e6 Fix “git-checkout” by adding HTTP auto-reconnect 2017-02-11 08:55:41 -05:00
Robby Findler
0ace11ddcd fix bug in build-source-location
closes #1605
2017-02-10 20:43:11 -06:00
Alexis King
6632beeca9 Fix wrap-expr/c and expr/c to reflect the intended use
The expr/c syntax class, as well as its underlying implementation
function, wrap-expr/c, previously produced misleading error messages.
The main purpose of these tools is to ensure a user-provided expression
conforms to a macro-provided contract. However, contract errors produced
by these forms were consistent with situations where both value and
contract were provided by the same party.

This fixes the discrepancy by changing how these forms assign blame to
emulate contract errors that arise from improper function arguments,
since most expressions provided to macros are semantically similar to
function arguments. All examples within the documentation itself
reflect this use case.

These changes alter the contents of error messages raised by expr/c and
wrap-expr/c, which could theoretically break some test suites, but it’s
extremely unlikely that any non-test code would depend on the precise
wording of contract error messages, and the interface is otherwise
completely backwards-compatible.

fixes #1412
2017-02-08 11:04:04 -05:00
Matthew Flatt
a5e7972bde JIT: fix handling of index argument to bytes-set!
When the second argument to `bytes-set!` is a reference to a
module-level variable that is definitely defined but not a known
constant, then an incorrect reordering was used that would cause
the third argument value to get overwritten before the call.

Closes #1601
2017-02-08 07:52:52 -07:00
Matthew Flatt
b3223ad8d2 bytecode compiler: add missing stack check in SFS pass
C-implemented recursive pass needs stack-overflow
check and handling.

Closes #1607
2017-02-06 17:19:57 -07:00
Matthew Flatt
2333251a26 note OpenSSL upgrade for native libraries 2017-02-06 17:19:57 -07:00
Robby Findler
84048f6776 avoid call to coerce-contract when we know it is already a contract 2017-02-05 14:37:04 -06:00
Robby Findler
8c5c8da1a7 fix fast path to not ignore pre/post conditions and bail out appropriately 2017-02-05 14:36:43 -06:00
Sam Tobin-Hochstadt
71a43f34c8 Use correct base path for finding gracket. (#1609)
Fixes error in http://drdr.racket-lang.org/38697/pkgs/compiler-test/tests/compiler/embed/test.rkt#output1
2017-02-03 15:19:28 +00:00
Sam Tobin-Hochstadt
8a49a8e545 Fix for PLT_DELAY_FROM_ZO custodian. 2017-02-02 17:06:40 +00:00
Ryan Culpepper
2def574c3c syntax/parse: clean up "at"/"within"-term handling
Added comments and examples about "at" and "within" terms
Fixed ps->stx+index bugs related to struct and vector patterns
2017-02-02 01:06:14 -05:00
Ryan Culpepper
febf3f36d7 syntax/parse: compress test, add more variants 2017-02-02 00:25:20 -05:00
AlexKnauth
68bd27707d add regression test for #1602 2017-02-02 00:25:20 -05:00
Ryan Culpepper
de60c00f56 syntax/parse: fix ps->stx+index; fixes #1602
Collapse CDR frames separated by ORD, POST, etc. For example,
(1 ORD 2 stx) should be same as (3 stx).
2017-02-02 00:25:20 -05:00
Stephen Chang
fe9f0e6e92 fix segfault when using preserved stx prop with non-interned-symbol key
closes #1594
2017-02-01 22:21:04 -05:00
Matthew Flatt
69d7636770 fix position counting with internal read shortcut
The primitive `read` uses a shortcut --- a private "ungetc"
implementation --- that did not count position correctly for
non-ASCII characters.

Closes #1599
2017-01-30 20:01:22 -07:00
Matthew Flatt
6c9dbea31f make pretty-print-newline work on any output port
The documentation says that it should work on any output port,
although there's special treatment of ports that originate
from `pretty-print` itself.

Closes #1579.
2017-01-30 05:41:49 -07:00
Matthew Flatt
572b96a6ef add 'gui-bin-dir as a separate configuration option
Allow the directory for GUI executables to be specified as different
from console executables. The defaults for those two are different
on Mac OS, and configuring them differently might be useful to
address #1575.

Although there is probably no demand on Windows or Unix for splitting
the console and GUI bin directories, this patch tries to make things
work sensible there. On Windows, there's a corner case where a
launcher that starts GRacket (especially with `-z`) is intended to be
a console executable. The launcher creator can be told that via a
`subsystem` option, but a new `#:console?` argument was needed for
`make-gracket-launcher-path` lets the path selector know.
2017-01-30 05:41:49 -07:00
Matthew Flatt
dc85374501 Add ignore-stderr submodule and test-ignore-stderrs "info.rkt"
These configuration options apply to `raco test` and mirror the
`--ignore-stderr` command-line flag.
2017-01-30 05:41:49 -07:00