Commit Graph

5164 Commits

Author SHA1 Message Date
Eli Barzilay
e311de0522 Improve some printouts.
Specifically the one from ,rr.  Also make ,switch syntax error more
friendly.  Also, test for the recent xrepl fix, including its printout.
2013-04-17 16:39:10 -04:00
Robby Findler
c50005870f adjust case-> so that the blame context information includes
which case of the case-> happened
2013-04-16 18:40:48 -05:00
Robby Findler
a46e4c71b6 fix case-> to not abuse procedure-chaperone
closes PR 13697
2013-04-16 18:40:48 -05:00
Matthew Flatt
6fe2861877 DrRacket: if any file in package X is open, treat X as "in development"
... for the purpose of "populate 'compiled' directories" --- but only if
the user has write permission for the package directory.

This change may or may not be a good idea. The idea is that installed
packages generally should be treated in the same way as the main
"collects" tree (e.g., avoiding debugging instrumentation), but if you
happen to be developing a package, then you want it treated like things
that are not in the main "collects" tree. So, how do you pick? Maybe
opening a file in the package is a good way to pick.
2013-04-16 12:51:54 -06:00
Matthew Flatt
551fd1c68d DrRacket: disable "compiled/drracket" during skipped-file load
If DrRacket decides to skip a file for "populate compiled",
then there may exist a file in "compiled/drracket", anyway,
or there may be such a file for some depenency of the skipped
file. Before this patch, that situation was considered to be a
broken installation, and things would go bad in the likely
case that the "compiled/drracket" files were out of date.

To avoid that problem, parameterize `used-compiled-file-paths'
to drop the DrRacket "populate compiled" target while loading
the skipped file.

This change sets up a more selective "populate compiled" where
a package's modules might switch between eligible and
ineligible for compilation by DrRacket.
2013-04-16 11:23:16 -06:00
Matthew Flatt
fe9350ea62 DrRacket: treat installed packages like "collects" directories
... for the purpose of "populate 'compiled' directories".
2013-04-16 11:04:28 -06:00
Matthew Flatt
25ddfcbfb3 ffi/com: repairs for parameterized-property setting and for date values
Merge to v5.3.4
2013-04-16 10:02:37 -06:00
Matthew Flatt
10e53e3bf4 pkg/lib: lock clean-up, and add `path->pkg'
Make the installed-package database lock reentrant, change some
functions to take the lock, and fix the documentation on when a
lock is expected to be taken outside of functions.
2013-04-16 08:58:19 -06:00
Asumu Takikawa
c7d878c009 Fix parsing when CNAME is provided for MX query
The code was assuming that the record type was
MX even though this could be false. Also adjusted
some code to also make it easier to test.

Note: the behavior when MX records are missing
is probably still not right.

Closes PR 13654
2013-04-16 10:52:55 -04:00
Robby Findler
ffd7b8fde3 another attempt to handle the #:important flag properly for blame objects
related to PR 13692
2013-04-15 22:12:46 -05:00
Matthew Flatt
b47c1857b5 raco pkg: support platform-specific package dependencies
A platform-specific dependency is useful for triggering
installation of a platform-specific library only on the
platform where its needed.
2013-04-15 06:21:49 -06:00
Matthew Flatt
37aa091e1c raco pkg: add support for local package-index databases
Adds `pkg/pnr-db', `raco pkg index-copy', and `raco pkg index-show'.

Includes tools to build a database of modules that are supplied by
packages, which will be useful for a tool to recommend package
installs when a module is not found.

Also, document `pkg/lib' and add extra helper functions
for getting package information from a package name resolver.
2013-04-15 06:21:49 -06:00
Eric Dobson
b8ab1334d9 Terminate typechecking on cyclic lists.
Closes PR 13687.
2013-04-13 20:23:19 -07:00
Robby Findler
79955e1204 fix the sense of the blame aspects of the blame object has a #:important
closes PR 13692
2013-04-13 18:38:34 -05:00
Stevie Strickland
ab66b485e5 Revert "Check that init args mentioned in contracts are provided."
This reverts commit 27b4df3eb5.
2013-04-13 17:35:22 -04:00
Stevie Strickland
27b4df3eb5 Check that init args mentioned in contracts are provided.
Closes PR 13693.
2013-04-13 17:31:39 -04:00
Stevie Strickland
eb12d76769 Add two spaces before contract error message fields (Reference section 9.2.1). 2013-04-13 17:31:39 -04:00
Stephen Chang
b3ba324a92 fix typed racket named let: error when there are no binding types
closes PR 13691

include in release
2013-04-12 18:25:55 -04:00
Matthew Flatt
9a52894b8b racket/enter: fix exception handling & propagation for `enter!'
Merge to v5.3.4
2013-04-12 14:58:54 -06:00
Asumu Takikawa
fa80c53115 Fix #:methods regression at top-level
Please merge to v5.3.4
2013-04-12 16:10:27 -04:00
Claire Alvis
d84494dd44 Fixes strange error messages for invalid generic method definitions
Closes PR 13681

Please merge to v5.3.4
2013-04-12 16:10:27 -04:00
Robby Findler
a425ee5207 improve the name of recursive-contract (thanks, Asumu!)
closes PR 13686
2013-04-11 22:44:56 -05:00
Matthew Flatt
06c42f0887 equality for `define-cstruct'-generated wrappers
Closes PR 13650

Merge to v5.3.4
2013-04-11 14:48:26 -06:00
Matthew Flatt
fd614991e6 code tweaks 2013-04-11 06:50:13 -06:00
Matthew Flatt
a9a20e9aa7 fix the name of `environment-variables-ref'
Also, fix use of unsetenv() to work with platforms where it returns
void.
2013-04-11 06:42:54 -06:00
Matthew Flatt
d4fa2766c2 performance tweaks for `for/{fx,fl,extfl}vector'
Also, provide a better error message when the body produces a
non-{fix,flo,extflo}num.
2013-04-10 17:26:38 -06:00
Matthew Flatt
e49956e3ea fix hole in validator
The validator was not as smart as the compiler in determining
that a `let' expression could be relied on to produce a
constant-shaped function (without side effect or error) in the case
that a right-hand side expression is a call to a known structure
constructor or predicate.

Closes PR 13679

Merge to v5.3.4
2013-04-10 15:06:13 -06:00
Matthew Flatt
6ea9a2b3e3 add `make-environment-variables'
Swap order of argument for `environment-variables-get'
and `environment-variables-set!', so that the environment
variables come first --- which follows the usual order.
This change means that the parameter isn't used to get
the default environment variables, but that seems ok; the
convenient interface is `getenv' and `putenv'.

On Windows, case-normalized environment variable names.

Also, change the implementation to use an immutable hash
internally.
2013-04-10 12:06:29 -06:00
Matthew Flatt
cfe9f447c8 fix sandbox test to avoid influence from other tests 2013-04-10 12:04:52 -06:00
Matthew Flatt
6e0492dff0 fix a UDP multicast test to make it work on Windows XP 2013-04-10 09:11:28 -06:00
Matthew Flatt
d5f32b649c racket/sandbox: add sandbox-make-environment-variables
By default, a sandbox gets a fresh environment variable set,
which means that it does not affect environment variables
outside the sandbox (which means that sandboxed code cannot
set the Racket process's OS-level environment variables).

Closes PR 13667
2013-04-10 06:59:33 -06:00
Matthew Flatt
3d1b0bd381 new environment-variable API
The `current-environment-variables' parameter determines the current
mutable "environment variable set". If that set is the initial one for
a Racket process, then using the set corresponds to working with OS
environment variables.  Otherwise, it's really just a hash table that
is packaged up as OS environment variables if a subprocess is created.

The new environment-variable interface works in terms of bytes, instead
of assuming that environment variable names and values fit in a string
encoding.

The string-based `getenv' and `putenv' are still available as
convenience wrappers. The checking on environment-variable names
for those wrappers is a little tighter, preventing any attempt to use a
name that contains "=".
2013-04-10 06:59:33 -06:00
Robby Findler
2decc99b26 add forgotten piece to the opt/c -> fix 2013-04-09 22:23:01 -05:00
Robby Findler
011f47540d fix opt/c for -> contracts when the function accepts keyword arguments 2013-04-09 22:02:49 -05:00
Robby Findler
b8058b381a adjust mzlib contract test suite for fixed or/c names 2013-04-09 22:02:49 -05:00
Robby Findler
caad82f91e remove the code duplication in opt/c
The code duplication was there only to support
constructing the name for the optimized contract;
instead we actually just built the name as we go
(the old version actually built the old contract
 and then used that to get the name)

also:
 - racket/contract/base now requires basic-opters.rkt
   so all of the opters are registered when racket/contract/base
   is loaded, not just the non-basic ones
 - fix the ordering of the names of subcontracts in or/c
 - make opt-contracts print a more meaningful name
2013-04-09 09:41:46 -05:00
Matthew Flatt
8b5523bd10 fix `for/flvector', etc. unsafety
Closes PR 13675

Merge to v5.3.4
2013-04-08 17:45:02 -06:00
Tony Garnock-Jones
94e36c8193 Tests for UDP multicast primitives 2013-04-08 15:23:01 -06:00
Matthew Flatt
bc5c89cbf0 fix a non-deterministic test 2013-04-08 14:43:29 -06:00
Vincent St-Amour
aac22e1ce5 Better error message for non-existent generics groups.
Closes PR13671.
2013-04-08 14:43:29 -04:00
Robby Findler
1ebf66252f fix test suite to match earlier fix to obligation info
merge to release branch, please
2013-04-08 13:40:56 -05:00
Robby Findler
6f7c938c0b fix ->m for keyword arguments
closes PR 13674
2013-04-07 19:57:41 -05:00
Matthew Flatt
88c7bb59d4 fix `udp-bind!' test 2013-04-06 10:50:02 -06:00
Matthew Flatt
f24b91a1cc fix interference of unboxing inference for different arguments 2013-04-06 06:42:01 -06:00
Asumu Takikawa
0161dfdf16 Translate Value types to ctcs with better names
e.g., True -> '#t  instead of
      True -> "#t" for a flat-named-contract
2013-04-05 16:56:50 -04:00
Eli Barzilay
26273db266 Avoid output in ftp tests.
Also add a note explaining why the output is not tested.
2013-04-05 02:23:43 -04:00
Eli Barzilay
6149134011 Misc improvements to net/dns' and net/private/ip'.
* Some racketisms.

* Use explicit `in-list' etc in for loops.

* Remove some redundant requires from `net/dns'.

* Move all tests to `tests/net', including a new `tests/net/ip'.  In the
  future there's a plan to have things like stripped zos etc for
  distribution, but we're not there yet, and the net collection is
  already organized nicely so this also makes it more uniform.

* Include the dns tests in the main test file.
2013-04-05 02:23:43 -04:00
Asumu Takikawa
8483a1493f Fix the returned type of dns-get-mail-exchanger. 2013-04-04 16:11:28 -04:00
Claire Alvis
04f535cadc Default implementations are only reached in the absence of method tables. 2013-04-04 15:31:51 -04:00
Vincent St-Amour
459c731bb9 Have Optimization Coach report unsound float division missed optimizations. 2013-04-04 15:31:50 -04:00
Eric Dobson
94861becd0 Fix untested contract generation code.
Closes PR 13449.
2013-04-04 08:29:15 -07:00
Eric Dobson
76de4d3cca Fix tc-apply to correctly generate expected ValueDots filters.
Closes PR 13649.
2013-04-04 07:45:15 -07:00
Eric Dobson
17b9ed0a75 Fix prefix-of.
Closes PR 13448.
2013-04-04 07:42:45 -07:00
Vincent St-Amour
d00a579c5a Document not yet fixed optimizer bugs found using random testing. 2013-04-04 10:05:53 -04:00
Vincent St-Amour
a50d9bad7e Avoid unsound optimization for complex division.
Found using random testing.
2013-04-04 10:05:53 -04:00
Eli Barzilay
af027020ba Adjust tests to x' instead of ×'. 2013-04-03 19:53:58 -04:00
Eli Barzilay
8ffd887847 Test for being able to customize struct printouts. 2013-04-03 18:10:22 -04:00
Danny Yoo
6e32a25253 Defensively check pos before subtraction in module-reader.rkt. 2013-04-03 14:26:16 -06:00
Eric Dobson
04ef9db1b3 Turn dynamic-requires into lazy-requires in TR.
Closes PR 13621.
2013-04-03 09:49:40 -07:00
Eric Dobson
0e0f1cd670 Adds subtyping for filters, and fixes -FS to be more precise.
Closes PR 12817.
2013-04-03 09:25:28 -07:00
Robby Findler
cce76eba00 fix bug in untar when unpacking a tar file with top-level files 2013-04-03 10:18:02 -05:00
Vincent St-Amour
ffc90239d0 Fix test for new complex division. 2013-04-02 17:32:29 -04:00
Vincent St-Amour
b808d2809e Fix optimization on exp of complex numbers.
Found using random testing.
2013-04-02 16:29:11 -04:00
Vincent St-Amour
8948388ec5 Fix another unsafe optimization of unsafe-fxmodulo.
Found using random testing.
2013-04-02 16:29:10 -04:00
Eric Dobson
3d49087ea3 Fix parsing of dotted rest when there is an expected type.
Closes PR 13646.
2013-04-01 22:17:32 -07:00
Vincent St-Amour
70a8b79d0e Re-enable testing of hyperbolic trigonometry functions. 2013-04-01 14:44:31 -04:00
Vincent St-Amour
990fa87a2e Add random testing for complexes.
Fix a bug it found.
2013-04-01 14:44:31 -04:00
Vincent St-Amour
ca2e6bd769 Sometimes generate random integers. 2013-04-01 14:44:31 -04:00
Vincent St-Amour
3e9595e910 Factor out grammar to generate well-typed terms with higher probability.
Allows us to test integer-specific functions.
2013-04-01 14:44:31 -04:00
Matthew Flatt
b78982fe6a racket/cmdline: fix problem with arity checking
Extra normalization due to 59b1e32fe9 exposed the bug.
2013-03-31 20:29:23 -06:00
Eric Dobson
5d8f470e0b Remove dependency on GUI libraries. 2013-03-31 11:43:08 -07:00
Eric Dobson
eeeceedb8c Reimplement for*/list: in TR so that it works.
Closes PR 13253.
2013-03-31 10:40:21 -07:00
Eric Dobson
ecec724747 Add testcase for sibling modules.
Closes PR 13155.
2013-03-31 10:39:16 -07:00
Carl Eastlund
f509420662 Removed unnecessary duplication of normalize-arity. 2013-03-31 13:36:06 -04:00
Carl Eastlund
636f8a91dc Moved normalized-arity?, arity=?, and arity-includes? into racket/function. 2013-03-31 13:36:06 -04:00
Carl Eastlund
59b1e32fe9 Changed normalize-arity to coalesce arity-at-least with adjacent numbers.
For instance, (normalize-arity (list 1 (arity-at-least 2))) now produces
(arity-at-least 1).  The implementation and the tests for normalize-arity both
reflect this change.  The randomized tests now also check that the output
represents the same arity as the input.
2013-03-31 13:36:05 -04:00
Ryan Culpepper
bace16a4ce added test for sequence syntax with keywords 2013-03-30 10:00:44 -04:00
Matthew Flatt
ba270cde48 fix over-eager "optimization" of some unsafe-fx operations
As reported by Vincent.
2013-03-29 14:46:19 -06:00
Matthew Flatt
5afd1b4118 syntax-color/racket-lexer: update for single-precision and extflonums
Includes a doc fix to note `+inf.t', etc.
2013-03-29 07:23:49 -06:00
Matthew Flatt
1dcc7ca4dc syntax-color/racket-lexer: fix long-standing number-parsing bug
The lexer mishandled cases like "#x1E+2", because "E" is
not an exponent marker for hexadecimal --- and it has been that
way forever, but the repair isn't all that difficult.
2013-03-29 07:23:49 -06:00
Matthew Flatt
45f74eafe5 scriblib/footnote: fix for non-Latex output
Also, fix warnings generated even for Latex mode.
2013-03-29 07:23:49 -06:00
Greg Hendershott
59bba2d197 Combine adjacent code spans into one.
These result from something like

    @racket[(x y)]

being treated by Scribble as multiple RktXXX items rather than one. As
a result the Markdown emitted was:

    `(``x`` ``y``)`

But obviously instead we want:

    `(x y)`

Kludgosity alert: Although it would probably be more-correct to
consolidate the RktXXX items at the Scribble structure level, I don't
easily see how. `@racket` is baking in the concept of Racket
lexing (classifying text as various kinds of Racket elements). This is
handy when the render will be HTML or Latek, and is benignly N/A when
it will be plain text. But it's a bit square-peg/round-hole when the
render will be Markdown. Rather than attempt to "un-lex" the Scribble
structures (I'm having trouble seeing how), I'm handling it
"after-the-fact" -- adjusting the generated Markdown text.

If anyone thinks the preceding is an elaborate rationalization for an
ugly kludge, I wouldn't argue, but I would need some help
understanding the preferable way to go about it.
2013-03-29 07:23:49 -06:00
Greg Hendershott
a5f6686270 Fix problem handling examples and interaction.
Unlike plain `racketblock`, `examples` and `interaction` are
"nested". As a result we emitted bad Markdown like:

    ```racket
    Examples:
    ```racket
    some-code
    ```
    ```

Markdown code blocks can't nest, so this needs to be:

    ```racket
    Examples:
    some-code
    ```

Also: Updated the unit test with examples of `examples` and
`interaction`.
2013-03-29 07:23:49 -06:00
Matthew Flatt
a5f8584bab scriblib/figure: add `#:continue?' option 2013-03-29 07:23:49 -06:00
Jay McCarthy
8a3f831807 Fixing standalone 2013-03-28 08:45:03 -06:00
Jay McCarthy
875c20119d Generalizing define-bibtex-cite 2013-03-26 06:08:21 -06:00
Eric Dobson
d7f12d93f4 Add testcase.
Closes PR 12812.
2013-03-25 08:50:48 -07:00
Jay McCarthy
5bb51aff4c Support all define-cite options in define-bibtex-cite 2013-03-25 08:27:51 -06:00
Jay McCarthy
b3b10a39f5 Support mastersthesis, clarify docs, and add test of rendering 2013-03-25 08:27:51 -06:00
Matthew Flatt
4d76aa2040 place channels & threads: improve GC
Allow a thread to be GCed when it is blocked on a place
channel for reading and the place channel's write end
is inaccessible.

GC is limited to threads that do not participate in cycles
of such threads, where the otherwise unerachable threads
are blocked on place channels that are reachable among the
set of threads. In other words, the GC finds the greatest
fix point (as measured by the threads to retain) instead of
least fix point --- which isn't what you want, but finding
the least fix point seems to require significant extra GC
machinery across places.

This improvement was intended to solve the same problem as
commit 7b0608c, but that case seems to run into the limitation
on cycles.
2013-03-25 05:15:24 -06:00
Matthew Flatt
b34fac32c0 fix space-safety problem
A tail call with certain kinds of primitives would fail to
clear local bindings in a detectable way. For example, a
tail call to `sync' that blocks could retain references
to unreachable data in the context of the `sync' call.

Primitives that can cause problems in the run-time system
are already identified as "imemdiate" primitives. The
safe-for-space pass now inserts clearing actions before a tail
call, unless the call it to a known immediate primitive or a
Racket-implemented function.

Clearing operations are now omitted before non-tail calls
to immediate operations like structure predicates.

The newly added clearing operations could affect performance,
but they probably won't, since the clear operations are still
avoided in tail-call cases that are otherwise fast. The newly
omitted clearing operations may improve performance.
2013-03-25 05:15:24 -06:00
Matthew Flatt
c3266ef685 fix `sync/[timeout/]enable-break' semaphore shortcut
The shortcut could be triggered in a bad case (first
argument as `#f' in non-timeout mode) and returned the
wrong result (void instead of the semaphore).
2013-03-25 05:15:24 -06:00
Eric Dobson
87facb736f Check for structure binding and raise good error if it is not there.
Closes PR 13588.
2013-03-24 18:35:22 -07:00
Eric Dobson
bb0b071f38 Remove legacy require/typed form. 2013-03-24 18:35:21 -07:00
Robby Findler
57f857b45a fixed more calls to error (that should be raise-argument-error) in the contract library 2013-03-24 08:09:08 -05:00
Robby Findler
64849bddd2 update mzlib contract test suite to recent changes to racket/contract 2013-03-24 07:24:32 -05:00
Robby Findler
6e4d483403 adjust contract library to call raise-argument-error instead of error
and a few other changes nearby to clean up various things

closes PR 13623
2013-03-23 22:00:29 -05:00
Eric Dobson
0e42a791a7 Typecheck (lambda args body) as (arg1 -> result). 2013-03-23 13:18:05 -07:00
Carl Eastlund
c8f79dacbb Added tests for blame object source locations being srcloc structs. 2013-03-23 01:06:24 -04:00
Eli Barzilay
f1e5bd8fd4 Undo no-op change.
As discussed:
  http://lists.racket-lang.org/users/archive/2013-March/056907.html
2013-03-22 11:22:49 -04:00