Commit Graph

621 Commits

Author SHA1 Message Date
Ryan Culpepper
e3d7c5a22c improve wording of "expected more terms" messages 2013-10-21 23:02:11 -04:00
Ryan Culpepper
454234cfc9 add "within:" line for stxparse errors
related to PR 13806
2013-10-21 23:02:11 -04:00
Sam Tobin-Hochstadt
ec77a48d23 Add access to the failure continuation in match. 2013-10-21 17:04:10 -04:00
Sam Tobin-Hochstadt
d6610289b8 Check that all in-repository packages have description and authors. 2013-10-20 11:08:03 -04:00
Matthew Flatt
64b1b1037e Mac OS X: make updated frameowrk paths a multiple of 8
Needed for code-signing (on 64-bit builds, at least)
2013-10-19 07:56:00 -06:00
Asumu Takikawa
3264a7fd61 Better error messages for class/object contracts 2013-10-17 17:57:40 -04:00
Sam Tobin-Hochstadt
8ef9b98d59 Use #:usage-help to describe the behavior of raco pkg install.
In particular, specify the new behavior when no pkg-sources are given.
2013-10-16 10:01:45 -04:00
Sam Tobin-Hochstadt
ac1a6ecda7 Add #:usage-help option to command-line.
This allows specifying additional help text at the
top of the auto-generated help, before the options
specification.
2013-10-16 10:01:45 -04:00
Matthew Flatt
44ee51f22f raco setup: add --unused-pkg-deps flag
This flag may be useful for checking for unnecessary dependencies, but
beware that it reports many false negatives, either because relevant
files are not compiled, because the dependency is dynamic, or because
unused packages are intentially listed as dependencies as a
convenience (as is the case for "main-distribution").
2013-10-15 17:50:32 -06:00
Matthew Flatt
833a368c66 document pkg/name
Also, tighten contracts and add `package-source-format?`.
2013-10-15 12:40:54 -06:00
Matthew Flatt
bbf446b0f4 raco setup: fix dependency checker to distinguish package name from source
Closes PR 14095
2013-10-15 12:40:41 -06:00
Jay McCarthy
0182e3ff33 Fixing broken build and improving error message 2013-10-15 10:53:59 -06:00
Jay McCarthy
38b2a08295 Fixing PR14088 by showing entire path 2013-10-15 10:38:27 -06:00
Jay McCarthy
8b08258c34 Another friendly error message for weak sauce users 2013-10-15 10:38:27 -06:00
Jay McCarthy
add6166fad Adding noun re PR13885 2013-10-15 10:38:27 -06:00
Jay McCarthy
9cba5e6e90 Fixing PR14062 2013-10-15 10:38:26 -06:00
Jay McCarthy
0a336024a9 Restoring old decoding behavior of net/url and allowing future compatibility by parameterizing what is accepted 2013-10-15 10:38:26 -06:00
Jay McCarthy
f8d3d6c81b Fixing PR14098 2013-10-15 10:38:26 -06:00
Matthew Flatt
3a9ad7746b OpenBSD: another approach to finding stack bounds
OpenBSD provides pthread_stackseg_np(), which directly reports
the stack-bounds information that Racket needs, so we can use
that instead of the approach used on other Unix variants. The
approach used for other Unix variants seems not to work for OpenBSD
because the stack location at the point that main() is called
is already significantly far from the stack base (on the order
of 100k on a 32-bit system in my test using OpenBSD 5.2).
2013-10-15 08:59:06 -06:00
Matthew Flatt
91ac5138ca raco pkg: fix access of 'default version info
Includes repair to `raco pkg catalog-show` to use the 'version table
in a package description.
2013-10-15 07:22:31 -06:00
Jay McCarthy
243533ba61 Give a more friendly message 2013-10-15 07:19:36 -06:00
Matthew Flatt
eb42f25a4e Windows: pass current directory CreateProcess instead of setting
Avoids races setting/using a process-wide current directory,
and avoids locking the directory that was most recently used to
start a subprocess.
2013-10-14 21:28:08 -06:00
Matthew Flatt
304d72fc6f raco pkg install: work around un-deletable directories
When installing a package "P" and the usual directory already exists
and cannot be deleted, then use the path "P+1", etc., and record the
alternate path in the package database.
2013-10-14 21:06:49 -06:00
Matthew Flatt
a2e75d1ff2 {copy/delete}-directory/files: raise "not dir or file" as exn:fail:filesystem
When a bad path is encountered, the problem should count as a filesystem
exception so that it can be caught with other filesystem exceptions.
2013-10-14 18:18:33 -06:00
Matthew Flatt
b83373d6a4 fix error typo 2013-10-14 18:18:33 -06:00
Matthew Flatt
e0c143ff33 fix problems with pipe limits
A pipe's limit is supposed to apply only to unpeeked bytes, but
there were problems related to triggering further writes after
a peek, and also triggering further reads after a partial
write.
2013-10-14 14:46:09 -06:00
Sam Tobin-Hochstadt
4a542969c7 Make 'raco pkg install' with no arguments install the current directory.
This is useful for telling people how to install a new pkg, from
GitHub or elsewhere: just get the files, and then do
`raco pkg install` in the relevant directory.

Also, both cabal (the Haskell package manager) and npm (the node.js
package manager) behave this way.

To explicitly get the old behavior, specify the sources as
`--pkgs pkg-srcs ...`.  This is useful in scripts, when `pkg-srcs`
might be empty.
2013-10-14 14:06:47 -04:00
Matthew Flatt
2a79377c60 further tighten eq-hash code generation
Avoids including the bit thet indicates whether the object
is GCable in the eq hash code (in a configuration where
bits are available in the GC header for hashing).
2013-10-12 08:37:15 -06:00
Matthew Flatt
8b7b96215b equal hash code: avoid dropping useful bits
Closes PR 14059

Symbols in the PR were mapped to coliding hashes in
groups of 4 because the low 2 bits of the `eq?` hash
code were begin dropped to generate an `equal?` hash
code. Those two bits got lost due to a refectoring
a while back that moved the dropping of two useless
bits to a more centralized place, but the 2-bit shift
did not get removed from the `equal` hash code comparision.

The PR's example program will still generate groups of 2
when hashing around 10k symbols (which used to be groups of 8).
That's because there's a bit in the hash-code counter that
turns out to be forced to 1.
2013-10-12 08:37:15 -06:00
Jay McCarthy
acedb0e02a New URLs for S3 hosted catalogs 2013-10-11 16:37:25 -06:00
Jay McCarthy
0371ade45e S3 doesn't give up HTTPS, so turn it off 2013-10-11 16:37:24 -06:00
baoti
d9f0d52c8a Fix path-replace-suffix' and path-add-suffix' on path for some system 2013-10-11 16:09:30 -06:00
Matthew Flatt
7e42ee2003 fix custodian-related memory-management problem
The problem mainly affected `register-custodian-shutdown`
from `ffi/unsafe/custodian`, which is used by `math/bigfloat`
and `ffi/unsafe/com`.

When a value is registered with a custodian, the value is held
weakly, but the shutdown procedure is intended to be held
strongly. At the C API level, the data associated with a shutdown
function pointer is intended to be held strongly.

A custodian itself, however, is retained weakly by other custodians
in its family, so that custodians can be GCed and their elements
transferred to a parent custodian. Since the custodian itself may
be held only weakly, the callback & data in a custodian was effectively
held weakly --- which, in turn, can break assumptions in code such
as `ffi/unsafe/custodian` that expects strong references to prevent
finalizers from running.

Fix the problem by registering a reference to callback data as
data in a custodian's finalizer, which makes the data strongly
retained no matter how the custodian is retained.
2013-10-11 13:11:13 -06:00
Matthew Flatt
23f4a8e56e racket/runtime-path: fix ".ss" vs. ".rkt" search for lib paths
The package split exposed another place where searching
is needed, because the fallback in `collection-file-path`
to `collection-path` didn't work after the split.
2013-10-11 13:11:13 -06:00
Matthew Flatt
e8605a7181 avoid internal error on misconfigured executable 2013-10-11 13:11:12 -06:00
Matthew Flatt
ca002494e3 fix an inconsistency in free-identifier=?
Closes PR 13982
2013-10-10 18:16:47 -06:00
Matthew Flatt
9a74e633ae macro expander: restore a minor shortcut lost in a previous commit
The commit c352ef8f lost a shortcut that is used for looking up
certain bindings in an environment during expansion/compilation.
2013-10-10 18:16:46 -06:00
Matthew Flatt
70b6f6464f fix .zo marshal of a syntax object containing a hash table in a list
Also, fix `zo-parse` unmarshaling of syntax-object hash tables.

Closes PR 14087
2013-10-09 07:09:36 -06:00
Matthew Flatt
f649599681 repair for 5eee14032f
This repair needs a test case, but I think the test will require a lot
of scaffolding to set up a package configuration, so I'm leaving that
part on my todo list for now.
2013-10-08 16:48:31 -06:00
Asumu Takikawa
8df734048c Fix error message for misuse of #:methods
Closes PR 14069
2013-10-08 14:32:34 -04:00
Ryan Culpepper
c4ba293c7e better "expected more terms" messages in some cases
Still need docs, make constant stxclass descriptions available
2013-10-07 09:23:11 -04:00
Ryan Culpepper
a086943b7c fix typo 2013-10-07 09:23:11 -04:00
Matthew Flatt
5eee14032f raco setup et al.: fix problem with relative paths that exit a collection
Closes PR 14063
2013-10-06 17:23:51 -06:00
Robby Findler
a13aed7420 fix name of struct constructor built by struct-out
closes PR 14073
2013-10-06 08:21:40 -05:00
Ryan Culpepper
007d563a41 fix attr check for ~optional defaults
closes PR 14076
2013-10-05 15:20:04 -04:00
Ryan Culpepper
383c363c68 fix dict-empty?
closes PR 14075
2013-10-05 15:20:04 -04:00
Robby Findler
1742545640 fix printing for vector contracts 2013-10-02 10:03:00 -05:00
J. Ian Johnson
b32697bd88 Conservative extension to match so that app patterns may produce and consume multiple values. 2013-10-01 16:25:20 -04:00
Matthew Flatt
68df43ac16 raco setup: fix command-line argument handling 2013-09-30 09:19:52 -06:00
Matthew Flatt
413985eeb4 fix treatment of an old-style ".plt" file as a package 2013-09-30 09:15:26 -06:00
Matthew Flatt
6d4ff30909 fix JIT bug related to unboxed arguments in self tail calls 2013-09-28 17:57:06 -04:00
Matthew Flatt
af7dcf0dd0 JIT: improve configuration dependency 2013-09-28 17:57:05 -04:00
Sam Tobin-Hochstadt
9f2755116d Remove units in parts of compiler, dynext, setup and create the cext-lib package.
`cext-lib` contains much of the contents of `dynext`, which
is no longer very widely used.

Also moved the implementation of the `mzc` executable
to a more appropriate package.

Also, used `lazy-require` consistently for dynamically
loading implementations.
2013-09-26 14:53:51 -04:00
Matthew Flatt
162edd099d box-cas!: less JIT-generated work if the boolean result is ignored 2013-09-26 14:21:39 -04:00
Robby Findler
a53c69e725 add #:omit-constructor option to struct form of contract-out 2013-09-20 14:38:35 -05:00
Matthew Flatt
6f1588fcac fix custodian-limit checking for phantom byte strings
Closes PR 14036
2013-09-19 16:56:01 -05:00
Matthew Flatt
5ccc6fb289 raco setup: allow an installer only in bytecode form 2013-09-19 10:51:55 -05:00
Matthew Flatt
68c4b0590d fix local-expand on module body with phase-2 binding 2013-09-19 07:27:57 -05:00
Matthew Flatt
10a931d688 fixup for showing dependencies during update 2013-09-17 13:30:21 -06:00
Matthew Flatt
b2f76bd8cc fixes for binary-package stripping
Avoid duplicate `assume-virtual-sources` definitions, add
`assume-virtual-sources` as needed in top-level collections
within a package.
2013-09-17 13:30:21 -06:00
Matthew Flatt
007f7d5992 raco setup: fix several triggers for building a doc index
In particular, fix various triggers that affect installing and
uninstalling packages.
2013-09-17 13:30:21 -06:00
Matthew Flatt
7016d3ab58 raco pkg {install,update}: guard against ill-formed arguments
Parsing a package source/name for scope inference should
report errors in the source/name syntax.

Closes PR 14026
2013-09-17 13:30:21 -06:00
Juan Francisco Cantero Hurtado
bb5323e448 Fix a crash of racket on OpenBSD systems, when pixman is compiled with SSE support and racket tries to load cairo using libffi.
Bug found initially by Juan Francisco Cantero Hurtado. Reported by many.

Mark Kettenis (from the OpenBSD Project) found the real reason of the
crash and created this patch for libffi. Patch taken from OpenBSD Ports.
2013-09-16 10:04:12 -06:00
Ryan Culpepper
ff06f0c8a7 delete unused code 2013-09-15 13:49:35 -04:00
Ryan Culpepper
954d6c764c move more db modules to db-lib 2013-09-15 13:49:35 -04:00
Ryan Culpepper
adc2ccbbd9 prepare to move more db modules to db-lib pkg 2013-09-15 13:49:35 -04:00
Ryan Culpepper
d2841d1113 add db/private/pre for pre-pkg clients 2013-09-15 13:49:35 -04:00
Matthew Flatt
e7090b8365 work around problem with ".ico" file handling 2013-09-13 21:17:43 -06:00
Ryan Culpepper
c596ec604f sync thread dynamic-place contract with builtin 2013-09-13 18:48:36 -04:00
David Vanderson
fb66c419de fix up error message 2013-09-13 18:21:11 -04:00
David Vanderson
fd68db2c7b make 'hex-string->bytes' public 2013-09-13 18:21:10 -04:00
Ryan Culpepper
23f77a6054 fix sqlite lib runtime-path 2013-09-13 13:54:07 -04:00
Ryan Culpepper
5258ffd8ca raco distribute should include sqlite dll on Windows 2013-09-13 13:07:58 -04:00
Robby Findler
e74b26fdbc adjust the planet resolver to explicitly ask for no
compression so that it gets a Content-Length field that
it can use back from the server

this may or may not be the right long-term fix but
for now it at least gets things working again
2013-09-13 10:38:47 -05:00
Matthew Flatt
160e5d3579 remove unused field 2013-09-11 08:34:27 -06:00
Kalimehtar
88d8a2a9f8 Added to _bitmask auto increment bit numbers
Now (_bitmask '(a b)) == (_bitmask '((a 1) b)) == (_bitmask '((a 1) (b 2))

Or (_bitmask '((a 8) b)) == (_bitmask '((a 8) (b 16)))
2013-09-10 08:25:22 -06:00
Matthew Flatt
24fc16674b repair for uri-decode
Certain inputs could cause `uri-decode` to go into a loop.

Patch and supplied by Doug Williams.

Closes PR 14010
2013-09-10 07:51:31 -06:00
Matthew Flatt
df2e2d76c7 JIT: fix slow path branch patch for structure-field assignment
The broken branch patch caused the slow path to be taken on
PPC.
2013-09-09 20:45:29 -06:00
Matthew Flatt
fc9b23e550 JIT: fix slow path for inlined structure-field assignment 2013-09-09 20:45:29 -06:00
Matthew Flatt
cb612245c7 raco pkg install: report useful error when GitHub checksum is "" 2013-09-09 20:45:29 -06:00
Matthew Flatt
41477ab7eb ARM JIT: make calls & returns visible for branch prediction
This improvement makes `inflate` about 5% faster on
one test platform (with no change on a much older one).
2013-09-06 20:02:06 -06:00
Matthew Flatt
fb80ac7385 minor JIT instruction improvement 2013-09-06 20:02:06 -06:00
Matthew Flatt
300e81cb65 fix some variable-initialization problems/warnings 2013-09-06 20:02:05 -06:00
Matthew Flatt
7969eea3a2 raco pkg install: drop redundant "COPYING.txt" and "COPYING_LESSER.txt"
When adding a package installation-wide, drop redundant "COPYING.txt"
and "COPYING_LESSER.txt" files (i.e., ones that are the same as the
ones the "share" directory of a Racket installation).

This rule is ad hoc, but it avoids almost 150 copies of the file in
the main distribution.
2013-09-06 20:02:05 -06:00
Matthew Flatt
e2ee051adc raco setup: avoid duplicate "scribble.css" files, improve style customization
Arrange for documentation added through an installation-wide package to
use the installation's "scribble.css", etc., files. Also, add "doc-site.css"
and "doc-site.js" files (both empty) to allow installation-specific customization
that will not get overwritten by document installs or builds.
2013-09-06 20:02:05 -06:00
Stephen Chang
6ba7834169 syntax/for-transform -> syntax/unsafe/for-transform 2013-09-06 19:01:19 -04:00
Sam Tobin-Hochstadt
23814ec5b3 Reimplement in-directory to not use call/cc.
`in-directory` definition by mflatt.
See mailing list thread at http://lists.racket-lang.org/dev/archive/2013-September/013277.html
for more details. Also includes sequence syntax version.
2013-09-06 18:14:42 -04:00
Stephen Chang
a84cf6b61d add syntax/for-transform
- provides expand-clause (as expand-for-clause) from racket/private/for.rkt
2013-09-06 16:46:41 -04:00
Jay McCarthy
54a75a4031 Print a summary of auto installs/updates rather than as we go 2013-09-05 08:51:05 -06:00
Jay McCarthy
5a7ce6d60a Support gzip encoded HTTP responses 2013-09-04 09:05:09 -06:00
Matthew Flatt
b5fe0203e2 remove bad return 2013-09-04 08:44:49 -06:00
Matthew Flatt
c38d1fabf9 raco pkg {install,update,migrate}: add --all-platforms
The `--all-platforms` flag causes the package manager to follow all
package dependencies, even for dependencies that are specific to
platforms other than the current one.
2013-09-04 08:44:49 -06:00
Matthew Flatt
16c0b385de raco setup: add install-platform to "info.rkt"
The `install-platform` value determines whether files are
copied to "lib" and "share" directories.
2013-09-04 08:44:49 -06:00
Matthew Flatt
6391fe4ed0 raco pkg create: extend --from-install mode so it can unmove files
This adjustment to packing allows a native-library package to
be converted back from installed to installable.
2013-09-04 08:44:49 -06:00
Robby Findler
85770c3cf2 add immutable hash constructors and selectors to #lang info 2013-09-03 15:59:14 -05:00
Sam Tobin-Hochstadt
b69e909f13 Use case instead of cond 2013-09-03 13:53:16 -04:00
Sam Tobin-Hochstadt
101d441fe2 This file is only needed for file/gif. 2013-09-03 13:53:16 -04:00
Vincent St-Amour
01c846ee5e Error message typo. 2013-09-03 11:31:35 -04:00
Matthew Flatt
62f7731c36 paco pkg: allow a commit id to be used in a GitHub reference
Allow a commit id in place of a branch or tag.
2013-09-02 10:10:31 -06:00
Matthew Flatt
61e6279c49 raco pkg: work with git tags as well as branches 2013-09-02 10:10:31 -06:00
Matthew Flatt
6530062120 raco pkg {install,update}: add --checksum argument
The `--checksum` argument's main use is that it lets you pick a specific
commit from a GitHub repository. More generally, it lets you simulate
a package-catalog result, which includes a checksum.

Also, adjust checking of downloaded checksums to ensure that they
match the expected checksum, as predicted by a package catalog or
by the `--checksum` argument.
2013-09-02 10:10:31 -06:00
Matthew Flatt
e0385f36c3 raco setup: fix info-domain, first
That way, if you interrupt a `raco setup`, then programs that rely
on a directory of "info.rkt" mappings are more likely to work.
2013-09-02 10:10:31 -06:00
Matthew Flatt
95368d238e raco pkg: handle bad collection strings
Also, add `setup/collection-name`, which provides functions for
checking collection-name syntax.

Closes PR 13886
2013-09-02 10:10:31 -06:00
Matthew Flatt
a30d80a9c4 move stray rackunit module 2013-09-02 10:10:31 -06:00
Robby Findler
864cc28341 add custom writers for a bunch of contracts 2013-09-01 07:57:09 -05:00
Matthew Flatt
0dcaa5e19f net/url: fix problems with new implementation on net/http-client
Various `net/url` operations need to request a close of the
connection after the operation completes, and `het/http-client`
needs to actually close the input-port half of a connection.

Also, add `http-conn-abandon!`.

Also also, add limits on internal pipes, so that data doesn't pile
up in a connection-processing thread, and fix POST/PUT by adding
a needed CRLF after posted data.
2013-08-30 10:37:09 -06:00
Matthew Flatt
701aa9ce0a openssl: allow ssl-abandon-port on input ports
Make `ssl-abandon-port` consistent with the docs and with
`tcp-abandon-port`.
2013-08-30 10:34:56 -06:00
Stephen Chang
6e42423a2c fix use of in-producer outside of for loops
- make-do-sequence was giving producer fn an argument when none was expected

Closes PR 13986
2013-08-29 17:25:18 -04:00
Ryan Culpepper
5c462eee2b remove uses of scheme/* in src
Fixes windows snapshot builds.
2013-08-28 21:48:53 -04:00
Carl Eastlund
ec5a9616e0 Renamed set-immutable? to set?. 2013-08-28 01:33:33 -04:00
Carl Eastlund
6665f42e33 Changed set? to generic-set?. 2013-08-28 00:10:18 -04:00
Carl Eastlund
899d57f687 Fixed define-generics so that predicate definitions follow method definitions.
I'm not sure that #:defaults and #:fast-defaults predicates should ever refer to
methods from the same generic interface, but the behavior should be divergence
rather than an undefined variable error.
2013-08-27 22:26:59 -04:00
Matthew Flatt
49e6a71f72 add "collects/realm/README.txt"
Guide readers of _Realm of Racket_ to the new location of
the "realm" directory.
2013-08-27 18:00:58 -06:00
Matthew Flatt
0b6f24e3b5 ffi/unsafe: unbreak _list-struct
Broken by 0b1f96ab3d (specifically one of my changes to
Tobias's patch).
2013-08-27 17:29:33 -06:00
Matthew Flatt
3d91b6b77f raco pkg: add a missing `close-input-port' on network connection 2013-08-27 15:20:58 -06:00
Matthew Flatt
10e2db7025 move "ffi/examples" from base to "racket-doc" 2013-08-27 15:20:58 -06:00
Matthew Flatt
d175c3949c move "scheme" collection to a "scheme-lib" package
Also, move remaining "srfi" libraries to "srfi-lite-lib".

In principle, "base" should depend on "scheme-lib" and
"srfi-lite-lib", and a new "base2" package would represent the new,
smaller base. But I don't think the window has yet closed on
determining the initial "base" package.

The "srfi" libraries moved to "srfi-lite-lib", instead of "srfi-lib",
to avoid creating many extra dependencies on "srfi-lib" and all of its
dependencies. The SRFIs in "srfi-lite-lib" depend only on "base",
and they are used relatively widely.
2013-08-27 15:19:24 -06:00
Tobias Hammer
0b1f96ab3d Add missing fender to define-cstruct
prevents internal error from libffi for
(define-cstruct _S ())
2013-08-27 10:15:25 -06:00
Jay McCarthy
a2b780abee note 2013-08-27 09:16:16 -06:00
Jay McCarthy
dc8f52dbb1 Do not send Host or Content-Length if user has 2013-08-27 09:16:16 -06:00
Jay McCarthy
41901397a7 Allow different HTTP versions 2013-08-27 09:16:16 -06:00
Jay McCarthy
fbccbd8ad3 Parse HTTP responses more generously 2013-08-27 09:16:15 -06:00
Tobias Hammer
e6886e4213 Fix missing initialization in filesystem-change-evt 2013-08-27 07:27:54 -06:00
Matthew Flatt
392a8219ae futures: fix rest-arg list creation
Also, make rest-arg list creation safe for futures (and slightly
faster in general).

Closes PR 13832
2013-08-26 20:17:52 -06:00
Matthew Flatt
44e324db12 ARM JIT: fix test for VFP
Having `__VFP_FP__` defined does not mean that VFP instructions are
available; it just means that floating-point is native-endian.

According to

 https://wiki.debian.org/ArmEabiPort

the absence of `__SOFTFP__` combined with the precense of `__VFP_FP__`
can mean VFP, though.
2013-08-25 12:54:04 -06:00
Matthew Flatt
100cc0f84e fix `{put,head}-[im]pure-port'
Connection wasn't converted to a port, and included a repeated
layer of chunk decoding.
2013-08-24 15:21:06 -06:00
Matthew Flatt
7e0d3beb67 ARM JIT: avoid direct use of __aeabi_... for software fp 2013-08-24 12:28:25 -06:00
Matthew Flatt
0b8e764e99 ARM JIT: fix soft-float `round'
Use our own implementation of round(), since the round()
function might be missing.
2013-08-24 10:39:09 -06:00
Jay McCarthy
e8bafbd9b9 Adding net/http-client and using it underneath net/url 2013-08-23 12:41:37 -06:00
Matthew Flatt
e1efd2d98f package system: change syntax of a GitHub package source to "git://..."
Besides changing the URL scheme, the tag or branch is optional and
specified as a fragment (inspired by npm). Also, any subpath is expressed
as a "path=..." query (which similarly avoids giving a different meaning
to URLs than `git' itself would). The repository name can have a ".git"
suffix.

The "github://..." format is still supported for compatibility, but
`--type github' adds "git://..." instead of "github://..." if
neither is already present (which is incompatible, since branches
and tags are handled differently for the two forms).

Closes PR 13656

(See the PR for a discussion and my rationale for this choice.)
2013-08-23 07:40:45 -06:00
Matthew Flatt
52da62a956 setup/dirs: fix "config.rktd" reader 2013-08-22 10:44:26 -06:00
Matthew Flatt
e7d300d238 raco pkg: improve package-source checking and error reporting 2013-08-22 07:58:49 -06:00
Matthew Flatt
d901504174 allow hash-table chaperones to support efficient hash-clear[!] 2013-08-22 07:50:42 -06:00
Matthew Flatt
3201f1330a raco pkg install: make --force override scope-conflict errors
It's possible that an installation will have a package X already and
a user wants to install a different X. To make it all work out,
the user may have to also install a new Y for every installation-scoped
Y that refers to X --- maybe not easy, but at least possible as
a last resort.
2013-08-20 20:53:58 -06:00
Matthew Flatt
f371032a34 protect package-source parsing against non-path strings 2013-08-20 15:48:15 -06:00
Matthew Flatt
c0af1fe4bd pkg: allow path string as `#:scope' argument 2013-08-20 15:27:33 -06:00
Matthew Flatt
ccead82841 raco pkg install: add --update-deps flag
This option makes install and update even more consistent, also
`--auto` still implies `--update-deps` only in update mode.

Make `--update-deps' consult the user in `search-ask' mode,
make it ignored in `fail' or `force' mode.
2013-08-20 15:27:33 -06:00
Matthew Flatt
21d3c168a0 support file:// URLs as package sources 2013-08-20 15:27:33 -06:00
Matthew Flatt
e02e04ff2a fix `hash-clear!' on impersonated hash tables
Closes PR 13977
2013-08-20 05:52:47 -06:00
Matthew Flatt
a4b994c3cb Revert "Revert "make user PLaneT install path use installation name instead of version""
This reverts commit de230bc1ef.

Now that path computatons are built in, and now that the sandbox allows
reading the configuration file, using the installation name doesn't
break with sandboxing.
2013-08-19 17:54:20 -06:00
Matthew Flatt
220b284175 find-collects-dir' and find-config-dir' as built-in, cache values
The computations already existed in the built-in code, so moving
the functions reduces code duplication. Caching the values will
save a little time, but mostly it will avoid sandbox interactions
with the task of locating the main "collects" and "etc" directories.
2013-08-19 17:54:20 -06:00
Matthew Flatt
31c7101ec7 raco pkg: make search-ask mode work for Windows (CRLF)
More generally, trim leading an dtrailing whitespace from answers.
2013-08-19 07:17:48 -06:00
Matthew Flatt
5efab46f5a net/win32-ssl: handle eof (connection closed by server) 2013-08-19 06:58:19 -06:00
Matthew Flatt
1b7819dcd5 Windows: disable message box from system errors
For example, disable a message box for DLL links errors.
2013-08-19 06:34:18 -06:00
Matthew Flatt
e4a4a52ea9 raco pkg install: fix problem with version-triggered updates 2013-08-18 13:38:48 -06:00
Matthew Flatt
884c0bef02 fix problem with inferred package scope
When the user-scope package database hasn't been created, a
parameter to avoid changing the database without a lock
was interfering with other scopes.
2013-08-18 13:23:58 -06:00
Matthew Flatt
d9e226824f net/win32-ssl: a native Windows SSL layer
This implementation of SSL ports is less complete than `openssl', but
it's complete enough to drive HTTPS, and so it can be used to download
a package that provides the DLLs needed for the `openssl' library.

The `net/url' library uses `net/win32-ssl' on Windows when `openssl'
is not available (due to the absence of the OpenSSL DLLs).
2013-08-18 10:57:04 -06:00
Matthew Flatt
f93f488a5a add PLT_DUMP_JIT_RANGES
This variable is intended to support machine-code tracing
experiments. To enable a dump of ranges on exit, both
define PLT_DUMP_JIT_RANGES at compile time and as an environment
variable at run time.
2013-08-17 08:42:15 -06:00
Matthew Flatt
72a4191aa9 raco pkg update: allow packages sources as replacements
When an argument to `raco pkg update` is a package source,
use it to place the currently installed package.

Also, make the set of available command-line arguments more
consistent, especially for `raco pkg install` and `raco pkg update`.

Finally, fix the `--update-deps` flag, including checking
the dependencies of each updated packages based on then update,
instead of the pre-updated package.
2013-08-17 06:03:10 -06:00
Matthew Flatt
6baf90e3be Documentation and adjustments to `clear'-related hash and set operations
Document and adjust `hash-clear!', `hash-clear', and `hash-empty?'.

Also, add `hash-copy-clear'.

The clear operations are constant-time for a non-impersonated
hash table, otherwise they always remove keys one-by-one to
trigger the impersonator's interpositions.

The `hash-clear' operation works only on immutable hash tables,
in contrast to the original implementation. The new `hash-copy-clear'
works on both immutable and mutable hash tables. The "copy"
in its name is meant to suggest a difference with `hash-clear',
even on immutable hash tables: any chaperone on the input
is not on the outpue.

Change `set-clear' to be like `hash-clear', and add
`set-copy-clear'.

(Changes are in consultation with Carl.)
2013-08-17 06:03:10 -06:00
Matthew Flatt
6fc868d5b9 raco pkg show: note when auto-installed packages are not shown
Otherwise, imagine uninstalling packages without `--auto', using `raco
pkg show' to confirm that none are left, and be surprised by a later
error about installed packages.
2013-08-16 15:25:40 -06:00
Robby Findler
27e9759bd5 add shrink-path-wrt 2013-08-16 14:07:55 -05:00
Matthew Flatt
1347073cc5 fix immutable hash tree balancing
When an existing entry in the AVL tree for an immutable hash
is replaced with a new one, the new one did not always get
the right depth, which could throw off the tree balance.
2013-08-16 11:35:40 -06:00
Matthew Flatt
6a6d60dd5f setup/dirs: add `find-user-links-file' 2013-08-16 10:24:18 -06:00
Matthew Flatt
f8a225f741 faster paths for parameter lookup
Calling a parameter function (with no arguments) can be 2-3 times
as fast as before.
2013-08-16 10:24:18 -06:00
Matthew Flatt
6035db418f pkg/lib: add `pkg-directory->module-paths' 2013-08-15 18:18:42 -06:00
Matthew Flatt
21bba8a10b package system: clients extract version-specific info from a catalog result
When a client sends a query to a package catalog, it includes a
version number in the query, and a package catalog can customize its
response to the version. That approach allows evoluation of the way
that versions are mapped to results, but it does not allow a
directory-implemented catalog to offer version-specific information.
Allowing both the server and the client to filter on the version is
even more flexible, and in particular allows a directory-implemented
catalog to include version-specific mappings.
2013-08-15 18:18:42 -06:00
Matthew Flatt
fb62686d8a raco pkg catalog-{show,copy}: add `--version' flag 2013-08-15 18:18:42 -06:00
Carl Eastlund
acc4afad6f Added raise-support-error and exn:fail:support to racket/generic.
The exn:fail:support exception is used to signal "unsupported" values for
generic methods, e.g. a vector as argument to dict-remove.  Right interface,
just the wrong kind of instance.  The exception type helps define the notion of
a "supported" method, since a method might have a fallback implementation yet
some values are not considered "supported".
2013-08-15 20:10:31 -04:00
Matthew Flatt
6b16d0b9de cm: change an "internal" error to show OS-level error 2013-08-15 06:21:19 -06:00
Matthew Flatt
d586ea4e99 pkg/path: improve use of cache in `path->pkg'
Cache exploded package paths, which cuts about half
(more than a second) of the start-up time for
`raco setup' on my machine.
2013-08-15 06:21:19 -06:00
Eli Barzilay
c069b8e51c Fix output of keys.
They need to be encoded in the same way that strings are
encoded.  (Report and fixed by Phil Roberts.)

Also added a FIXME about leftover occurrences of \U in the output.

Closes PR 13966.
2013-08-14 16:51:31 -04:00
Matthew Flatt
35608b36b4 setup/getinfo: change bootstrap mode to try bytecode
Loading "info.rkt" files always from source turns out to be
expensive (adding 1 second or so on my machine to the startup
time for `raco setup'). Change bootstrap mode to try the compiled
form and fall back to source if its doesn't work.
2013-08-13 16:05:36 -06:00
Matthew Flatt
3f8475d6a9 optimizer: certain bitwise-operation patterns always produce fixnums 2013-08-13 16:05:36 -06:00
Matthew Flatt
de322740a6 file/gzip: misc clean-up
Separate state and functions, and convert a key loop to functional
style. As it turns out, this has no significant effect on performance,
but it looks a lot better to me.
2013-08-13 16:05:36 -06:00
Matthew Flatt
1acdcf2fb9 speed up gzip by moving struct definitions
Moving the `define-structs' to the module top level
makes it easier for the JIT and cuts compression time by
about 1/3.
2013-08-13 16:05:36 -06:00
Matthew Flatt
ccb31f4153 fix name handling in `tar-gzip' 2013-08-13 16:05:36 -06:00
Matthew Flatt
b1e33773c6 increase stack safety margin for 64-bit platforms
Make the stack-safety margin twice as big for 64-bit platforms
as 32-bit platforms. That was already done for Windows, but it's
also needed for Mac OS X. Also, double-check that there's a
good amount of space on the stack before calling a foreign
function.
2013-08-12 19:42:36 -06:00
Matthew Flatt
d52ba1b5e7 fix interaction of continuations and stack overflow
There was an off-by-one error in trimming overflow
records in a captured continuation.

I provoked the crash by running the program below on Mac OS X;
resizing the frame caused a crash. It has something to do with the
`try-atomic' implementation, I think. I wasn't able to make a test
case in a half-hour of trying, however, and I'm giving up for now.

(define f (new frame% [label "deep"]))
(define b (new button%
               [parent f]
               [label "0"]))
(send f show #t)
(let loop ([n 0] [m 0])
  (if (= n 10000)
      (begin
        (send b set-label (format "~a" m))
        (for ([i 10]) (yield))
        (loop 0 (add1 m)))
      (cons 1 (loop (add1 n) m))))
2013-08-12 19:42:36 -06:00
Matthew Flatt
74e49d8499 enable JIT stack trace on arity errors
On x86_64 Linux and Win64.
2013-08-12 16:27:06 -06:00
Matthew Flatt
04454678eb remove unnecessary stack-unwind test
The test was meant to detect a bad traversal step, but it could unnecessarily
truncate the stack traversal when encountering recursive calls.
2013-08-12 16:22:18 -06:00
Matthew Flatt
8f9e6529da fix (extracted part of) libunwind for x86_64
I had mixed up EBP vs. REG_EBP, etc., in extracting the x86_64 code.
2013-08-12 15:02:24 -06:00
Matthew Flatt
2d8edeffe8 make install: drop -S' flag to strip'
It turns out that no flags are standard, so don't try to use
any. That seems to be fine on the platforms that I tried.
2013-08-12 15:02:24 -06:00
Matthew Flatt
89e99657dd raco pkg {install,update}: add a `--auto' shorthand 2013-08-12 15:02:24 -06:00
Robby Findler
680d29d9cc adjust some calls to sort: use symbol<? and use strict
predicates (to get stability)
2013-08-12 12:27:16 -05:00
Matthew Flatt
502deb3bae setup/getinfo: add `#:bootstrap?' mode
Bootstrap mode disables the use of a compiled form of "info.rkt",
in case the compiled form is broken. It also attaches `info'-language
modules from the `setup/getinfo' namespace to the "info.rkt"-loading
namespace.

Formerly, `raco setup' relied on capturing the bytecode-compilation
bootstrap context used for `raco setup' itself when loading info
files. But when `raco pkg install' used `raco setup', it didn't have
the same bootstrapping context in place, so it could get confused
(e.g., if you unlink a package from one Racket version and install it
as a link in a different Racket version). Now, both `raco setup' and
`raco pkg' use `#:bootstrap?' mode for `get-info/full'.
2013-08-12 07:09:04 -06:00
Matthew Flatt
7c638a03a0 remove some obsolete files 2013-08-12 07:07:27 -06:00
Matthew Flatt
35bff5b683 first cut at script to push PLT packages to pkg.racket-lang.org 2013-08-11 14:30:04 -06:00
Matthew Flatt
7c95c5ad38 add path<?' and symbol<?'
These comparisons are useful for sorting while avoiding the overhead
of conversions to bytes or strings.

Having `path<' reduces the cost of sorting in `directory-list'.
2013-08-11 14:30:04 -06:00
Matthew Flatt
2ba615a20e directory-list: always sort results
Consistently sorting shouldn't cost much relative to the
cost of `directory-list' (except for the path->bytes conversion?),
and it makes directory traversals (including archive packaging)
more deterministic across runs and platforms.

(Eli suggested this a long time ago.)
2013-08-11 14:30:04 -06:00
Robby Findler
13e7f2f03d try to be more accomodating to low-permission contexts
when reading the development links file
2013-08-11 06:56:16 -05:00
Matthew Flatt
58c0074a71 Add ".desktop" file support
A launcher can have a ".desktop" file (found like other files: as the
same name as the main launcher file, but with a ".desktop" suffix),
where the "Exec" and "Icon" fields are added automatically. A ".png"
or ".ico" file can be supplied for the icon (where the ".ico" file
is already used for Windows launchers).

Closes PR 13953

Fix various problems with Unix-style install from an installer.

Also, add an ugly icon for the Racket Package Manager, with the hope
that it will provoke someone to create a nicer one.
2013-08-10 12:52:17 -06:00
Robby Findler
c93debe653 fix error check in #lang info 2013-08-10 05:34:22 -05:00
Matthew Flatt
47d433b9c1 Solaris: disable places and futures by default
The issue is that gcc and the Sun linker do not cooperate
correctly to implement thread-local variables on x86_64.
Since gcc is normally configured to use the Sun linker by
default, enabling places and futures is asking for trouble.
2013-08-09 19:46:37 -06:00
Matthew Flatt
19cda0396b fix stack size of threads that implement places
... on platforms other than Mac OS X and Linux.
2013-08-09 14:26:32 -06:00
Matthew Flatt
6bb55f7d14 Solaris: various repairs
Fix threading, including SIGCHLD mask.
2013-08-09 10:49:46 -06:00
Matthew Flatt
3ca82d5df7 fix subprocess issues
Fix SIGCHLD suspension for fork()-based file locks (i.e., Solaris).

Also, fix commit ea51d32e, which broke termination of process groups
where the main process terminated before the rest of the group,
because it used sigwait() before the terminate action.
2013-08-09 07:55:14 -06:00
Matthew Flatt
d93ce089a3 fixes of OpenSolaris
Make the GC always use the mmap() block cache, since mmap() on Solaris
allocates much more than a page when a single page is requested.

Enable places and threads by default on x86 and x86_64.

Fix pthread-related compilation flags.
2013-08-09 07:55:14 -06:00
Matthew Flatt
9068341cb9 JIT: add missing check on inlined `procedure-arity-includes?'
Closes PR 13951
2013-08-08 17:57:49 -07:00
Robby Findler
a8405eb77d Adjust contract-out so it uses the provide transformer machinery properly
closes PR 13946

This is probably not the optimal way to make this change; better would
have been to refactor the existing provide/contract implementation so
it does not glom the provides all together in the first place (instead
of pulling them out afterwards). Do it this way anyways, because I
have a big pile of contract-system changes in another branch that also
changes around how provide/contract works: this way will be much
easier to rebase those changes off of.
2013-08-07 15:49:08 -05:00
Matthew Flatt
b8db5aacb3 fix bytecode-format bug
The range of values used to represent "improper lists"
of length 36 to 65 overlapped with the range of values
used to represent other things.

This bug is the new chapion of the "how did we not hit that
earlier?" category. The bug was introduced around v300, at
the latest.
2013-08-07 08:37:50 -07:00
Matthew Flatt
de230bc1ef Revert "make user PLaneT install path use installation name instead of version"
This reverts commit ac20e7fc0d.

Using the installation name name seems right, but it creates sandbox
trouble, since finding the instalation name requires several
path-chasing steps. I think the sandbox problem shoudl be fixed,
somehow, but since I don't have a good idea right now, I'm reverting
the PLaneT change.
2013-08-04 10:35:30 -06:00
Matthew Flatt
c67fd14ae8 remove prohibition on handle-evt?' arguments to wrap-evt', etc.
The intent of disallowing `handle-evt?' arguments to `wrap-evt',
`handle-evt', and `chaperone-evt' was that those extra wrappers
break the tail-handling behavior that is almost certainly intended
when `handle-evt' is used. The extra checking was not obviously
worthwhile (we don't have any checked "this procedure should be called
in tail position" annotations, after all), and pushing the distinction
through Typed Racket looked particularly inconvenient.

Dropping the constraint is trivial if we say that wrapping a
`handle-evt' result disables the tail invocation of the handler
procedure.
2013-08-04 10:35:30 -06:00
Ryan Culpepper
4bc24a1117 added nearest below & above to find-seconds error message
Closes PR 13945
2013-08-03 18:20:46 -04:00
Ryan Culpepper
7d2c1c0790 fix exprs field for raise-syntax-error* 2013-08-03 18:20:33 -04:00
Matthew Flatt
df30e9c148 add missing lock acquire 2013-08-03 13:56:18 -06:00
Matthew Flatt
5e0b87a0cd raco pkg {install,remove}: promotion from & demotion to auto-installed
When you `raco pkg install' a package that is already present as
an auto-installed package, the installation is promoted to
an explicitly installed package.

When you `raco pkg remove --demote' a package, then it is changed
from an explicitly installed package to an auto-installed package.
Combine `--demote' with `--auto' to remove a package only
if there are no dependencies, leaving it auto-installed otherwise.

The defaults (promote in the case of `install', not demote in the case
of `remove') are different because it seems more likely that you
really mean to remove a package when using `pkg remove', while it
seems likely that you just want to start using a package that happened
to be auto-installed already for `pkg install'.

Also, make the package scope inferred for `raco pkg' commands
that take a list of package names, and fix up lock handling and
error reporting.
2013-08-03 12:18:46 -06:00
Matthew Flatt
ac20e7fc0d make user PLaneT install path use installation name instead of version 2013-08-02 11:19:33 -06:00
Matthew Flatt
d63b49ccbb `raco pkg' repair 2013-08-02 11:19:33 -06:00
Matthew Flatt
8eefa2126b add `current-library-collection-links' parameter
Also, the initial value causes `curent-library-collection-paths'
before collection links files, instead of after.
2013-08-02 08:24:15 -06:00
Ryan Culpepper
e0f3876e8c indent multi-line details, export more helpers 2013-08-01 19:11:28 -04:00
Ryan Culpepper
94c5e5e250 rename raise-misc-error to error* 2013-08-01 19:11:28 -04:00
Ryan Culpepper
30d6863e44 moved raise-syntax-error* to unstable/error 2013-08-01 19:11:28 -04:00
Ryan Culpepper
ed5b0afbac syntax/parse: reformat, add more info to errors 2013-08-01 19:11:28 -04:00
Ryan Culpepper
e20b5a1539 fix multi/maybe detail handling, allow missing who argument 2013-08-01 19:11:28 -04:00
Ryan Culpepper
7b113899d4 syntax/parse: removed unused exn info 2013-08-01 19:11:28 -04:00
Matthew Flatt
1b98359925 raco pkg install: use `--link' by default for directory sources
The new `--copy' flag provides the old behavior.
2013-08-01 07:01:20 -06:00
Matthew Flatt
a6f8f00f55 fix cross-phase-persistent attribute of primitive modules 2013-08-01 05:55:24 -06:00
Matthew Flatt
e5e6d097be ffi/unsafe/objc: fix selector definition lifting
The code intended to lift each selector only once (per lifting
context) was broken.
2013-07-31 17:28:56 -06:00
Matthew Flatt
c137b44a68 change `syntax-local-lift-context' to distinguish top-level environments
Although not documented as such, the implementation used to return
form did not take the special meaning of #f into account. It seems
better to fix `syntax-local-lift-context' to match its documentation.
2013-07-31 17:28:56 -06:00
Ryan Culpepper
f5b91941eb fixed hash-code for id-tables
Closes PR 13942.
2013-07-31 17:37:42 -04:00
Ryan Culpepper
2057b51f21 syntax/parse: add "expected more terms" message
Only for proper list patterns; otherwise, "more terms" might be
mischaracterization.
2013-07-31 17:37:15 -04:00
Matthew Flatt
7e3ee7105a fix `raco link -l'
Closes PR 13941
2013-07-31 12:09:59 -06:00
Matthew Flatt
895b8d2760 configure: fix `--enable-portable-binary' addition 2013-07-29 10:58:16 -06:00
Carl Eastlund
b192620b0d Restored behavior of set/c for flat contracts; #:kind defaults to 'immutable. 2013-07-28 23:52:27 -04:00
Matthew Flatt
df34ffe450 configure: pass `--enable-portable-binary' to libffi configure
The `--enable-portable-binary' flag disables optimizations specific
to the build machine's processor that may ne unportable to other
machines.

This also fixes a problem where a VirtualBox runs on an x86_64 machine
with AVX support, and so `congure' enables AVX operations, but AVX
doesn't work within a virtual machine.
2013-07-28 11:46:10 -06:00
Carl Eastlund
1c7cdfb302 Fixed a few bugs in set/c's keyword options, and one test for set/c.
Specifically, set/c no longer behaves as a flat contract, so it is necessary to
apply at least one set operation to detect a contract error on an element.  It
is possible the flat behavior can be restored for some kinds of sets, but it's
not immediately obvious what kinds those should be.  (Immutable hash sets in
particular?  Any sets that don't implement set-add! or set-remove!?)
2013-07-27 13:17:53 -04:00
Matthew Flatt
2ec49929a4 raco setup: print "summary of errors" before the summary of errors 2013-07-26 22:36:21 -06:00
Matthew Flatt
81079b3a02 Windows installer: offer to auto-launch DrRacket
The 'start-menu? aux key for launcher creation changed to 'start-menu,
with a real-number value indicating a request and precedence for
auto-launching (where a precedence is needed because only one application
can be auto-launched).
2013-07-26 22:36:21 -06:00
Matthew Flatt
67c33fb13d adjust startup to avoid config file if collection links are disabled
The intent of this change is to avoid trying to read a configuration
file from a stand-alone executable.
2013-07-26 22:36:21 -06:00
Matthew Flatt
2e067ab28c add build-stamp' configuration and fix repo-time-stamp/stamp'
The "repo-time-stamp" collection used to be omitted from a
release, but to keep things simpler, it's staying in the
"drracket" (and therefore "main-distribution") package. The
build process installs an empty `build-stamp' value (by default)
into a release build, or it installs a useful stamp for
a non-release build.
2013-07-26 22:36:21 -06:00
Robby Findler
6195c432f8 Add use of 'sub-range-binders properties for Check Syntax's benefit 2013-07-26 19:05:46 -05:00
Matthew Flatt
d94a4cd830 add migration panel to GUI package manager
Also add "gui-pkg-manager" packages, including a "Racket Package Manager"
GUI application (that needs a better icon).

The package that supplies "Racket Package Manager" is not in the main
distribution, since DrRacket already includes the GUI package manager.
2013-07-26 14:07:05 -06:00
Matthew Flatt
e776821e31 add `raco pkg migrate' 2013-07-26 13:18:06 -06:00
Matthew Flatt
9f14fe3f6d make installation name configurable via `raco pkg config' 2013-07-26 11:52:48 -06:00
Matthew Flatt
68f4d297f7 make a build via the top-level makefile set scope to `installation'
Also, set the installation name to "development".
2013-07-26 11:52:48 -06:00
Matthew Flatt
afe8c37a2a user paths depend on name (not always version); no `shared' pkg scope
An installation has a name (via the configuration file "config.rktd")
that defaults to the version string. The name, instead of the
Racket version, is used for forming the path to the user "collects"
directory, user packages, and so on. The `user' package scope is
thus user- and installation-name-specific (instead of user- and
version-specific).

Remove `shared' package and link scope, since the notion of
installation names generalizes the concept (a set of installations
can be given the same name) and fits it into `user' scope.
2013-07-26 11:52:47 -06:00
Matthew Flatt
e0bab441a8 fix `get-output-{bytes,string}' with bad starting index, no ending index
Closes PR 13933
2013-07-25 20:39:57 -06:00
Carl Eastlund
2f473c2403 Added tools for contracts, impersonators, and chaperones for generic interfaces.
Added four macros to racket/generic:
- chaperone-generics
- impersonate-generics
- redirect-generics (dynamically chooses between the above two)
- generic-instance/c
All take pairs of method names and wrappers (procedures or contracts),
and turn those into appropriate chaperone, impersonator, or contract wrappers
on the method tables of the given structs.

Used this to rewrite set/c to give better error messages.
2013-07-25 13:49:00 -04:00
Carl Eastlund
6b337efd2f Changed "generics group" to "generic interface" in errors and documentation. 2013-07-25 13:49:00 -04:00
Carl Eastlund
a651591a15 Added gen:set, mutable and weak sets, and custom set types.
Sets are now implemented as a generic interface, and lists count as sets.  Most
of the set functions have been added as methods, including mutable versions of
imperative update methods.
2013-07-25 13:49:00 -04:00
Carl Eastlund
da1fe888a7 Added dict-copy operation; renamed dict-supports(?|/c) to dict-implements(?|/c).
Similar to hash-copy or string-copy, dict-copy creates a new, mutable copy of
the given dictionary.  Added as a method of gen:dict.
2013-07-25 13:48:59 -04:00
Carl Eastlund
5c1728dce4 Added define-custom-hash-types and make-custom-hash-types.
The definition form and function consume an equality predicate and optional hash
code functions and key predicate, and produce predicates and constructor
functions for hash table-based dictionaries using the given equality and hash
functions.  Immutable, mutable, and weak dictionaries are defined.
2013-07-25 13:48:59 -04:00
Carl Eastlund
81bcd73aa7 Extended the gen:dict interface; also added some dict and hash operations.
- Added hash-empty?, hash-clear, and hash-clear! for hash tables.
- Added dict-empty?, dict-clear, and dict-clear! for dictionaries.
- Made all dict functions exported by racket/dict into generic methods; turned
  the existing implementations into fallbacks.
2013-07-25 13:48:59 -04:00
Carl Eastlund
97b78ace5b Added #:dispatch option for clauses in #:defaults and #:fast-defaults.
The #:dispatch option specifies a second, less strict predicate for a #:defaults
or #:fast-defaults clause.  The main predicate is still used for the generics
group's type predicate, but the dispatch predicate is used in choosing which
method implementation to use.  The #:dispatch option is useful when the dispatch
predicate is disjoint from all other instances, is significantly cheaper to run
than the main predicate, and the full checks can be meaningfully deferred in
method implementations.

Specifically, this is useful in the implementation of iteration for
association-list dictionaries.  The dict-iterate-{next,key,value} functions do
not need to test (andmap pair? dict) if the given dict is eq? to the one stored
in the given iterator.  The dispatch predicate, list?, is much cheaper.
2013-07-25 13:48:59 -04:00
Carl Eastlund
d9890b843a Changes to define-generics: added #:defined-predicate; improved generated code.
The #:defined-predicate option is like #:defined-table, but it defines a
two-argument predicate that only processes the requested method name and doesn't
allocate a hash table each time it is called.

Method implementations provided via #:fallbacks, #:defaults, and #:fast-defaults
are now called directly by method procedures rather than stored in a vector and
extracted by index.  This should hopefully improve inlining for methods.
2013-07-25 13:48:59 -04:00
Carl Eastlund
1f267d479c Added #:fast-defaults option to define-generics.
For datatypes that are disjoint with structs that might implement the generic,
this adds a "fast path" implementation that doesn't need to test for struct
properties.
2013-07-25 13:48:59 -04:00
Carl Eastlund
7deb4ad025 Separated prop:dict from gen:dict.
This work is in preparation for widening the interface of gen:dict with
operations like dict-for-each, dict-update, etc., each with a fallback
implementation.  The property prop:dict, with its documented, fixed-length
vector representation, cannot be extended, whereas a generic with optional
methods can be.
2013-07-25 13:48:58 -04:00
Carl Eastlund
f7f15e1113 Added a #:derive-property option to define-generics.
The define-generics form can now derive existing struct properties, so that any
instance of the new generics group is also an instance of the struct property.
2013-07-25 13:48:58 -04:00
Matthew Flatt
a5d724dda4 file/tar: limit pipe size between tar and gzip
Otherwise, tar is likely to get ahead of gzip and use much
more memory.
2013-07-25 10:11:05 -06:00
Matthew Flatt
aeb3372faf more safe-dereference repairs for DWARF native stack trace (on ARM) 2013-07-23 20:38:23 -06:00
Matthew Flatt
a31e9b29e0 no dprintf() macro in libunwind to avoid collisions on some platforms 2013-07-23 19:59:00 -06:00
Matthew Flatt
245a688c2e fix for inotify() use with places and futures disabled 2013-07-23 19:46:10 -06:00
Matthew Flatt
9f0c5b1487 fix x86_64 DWARF-based stack trace
Commit 5917d4c added a guard on some pointer dereferences, but
the guard is too strict for DWARF. Allow reading of TEXT segments,
etc.
2013-07-23 17:20:20 -06:00
Matthew Flatt
cba5bb7729 distro-build: allow missing "man" directory (for Windows) 2013-07-22 21:15:41 -06:00
Carl Eastlund
59ee9a227e Improved the error messages from generic interface contracts.
Previously, a failure during the first-order checks would print out the name of
the full contract for all the methods, while describing the value for just one
method.  This is both misleading, and incredibly verbose.  The new version
prints out just the relevant contract.
2013-07-22 22:24:18 -04:00
Matthew Flatt
0eb29a4dcf fix `raco setup' package-dependency check when PLaneT package is installed 2013-07-22 18:32:40 -06:00
Matthew Flatt
5457f72391 show package for each module in documentation
The package is normally determined automatcially, but
the `defmodule' form also supports a `#:packages' option.
2013-07-22 18:32:39 -06:00
Matthew Flatt
f85221afca adjust ".plt" S-expression matching to accept more old archives 2013-07-22 16:34:21 -06:00
Matthew Flatt
682916c8fe raco pkg show: include only non-auto by default 2013-07-22 16:20:14 -06:00