Matthew Flatt
fe557c0e93
Cygwin: one more repair
...
Also, add a missing dependency that caused me to miss this correction
before.
2014-11-01 10:42:28 -06:00
Matthew Flatt
cdf0dc8ed2
Windows: MinGW fixes
2014-11-01 08:17:52 -06:00
Matthew Flatt
cceda78374
restore Cygwin support
...
Fix various configuration problems, and make the build work with 3m
(probably for the first time).
The repairs include corrections for the manual link table, but also
switch Cygwin to relying on normal DLL exports, instead, to work
properly with the FFI.
The `--enable-shared` comfiguration option is no longer required for
Cygwin. When it is used, the `gracket` launcher does not work right,
because the Cygwin DLL is in the "bin" directory and "gracket.exe" is
in the "lib" directory. Along similar lines, stand-alone executables
won't work with `--enable-shared`.
The change to `ffi/winapi` makes it match the documentation.
2014-11-01 06:50:24 -06:00
Matthew Flatt
d7ee4c3fb5
change logger terminology: "name" => "topic"
...
Originally, the symbolic "name" of a logger was just a string to
prefix any message sent to a logger. The symbol has evolved instead
into a first-class component of an event to be used for message
selection and filtering; the word "topic" more clearly communicates
that role.
This is just a documentation change. The `logger-name` function would
be better called `logger-default-topic`, but it's staying the same for
compatibility.
Based on comments from Tony Garnock-Jones.
2014-10-31 16:48:41 -06:00
Matthew Flatt
58eb802468
add log-all-levels
and log-level-evt
...
These two functions allow the creation of relays that receive events
on logger B where there are interested receivers for logger A.
Based on comments from Tony Garnock-Jones.
2014-10-31 16:48:41 -06:00
Matthew Flatt
38ac6e052c
compiler/cm: filtered logging propagation instead of manual
...
With the new propagation-filtering support, CM's accomplice channel
doesn't need a receiver that accepts all events, and so less logging
logging work will be triggered during compilation.
2014-10-31 16:48:29 -06:00
Matthew Flatt
159c82fc4a
make-logger: support specification of events to propagate
...
Events to propagate to a parent are described in the same way
as events to receive for a log receiver. The default is still
to propagate all events to the parent, which corresponds to
a propagation specification of 'debug.
Making a propagation-filtering specification built-in, instead of
allowing arbitrary filter functions, keeps `log-level?` efficient and
avoid hooks that might be implemented by untrusted code.
2014-10-31 16:48:29 -06:00
Matthew Flatt
83b4595741
log-level?, log-max-level: accept optional name argument
...
Change `log-error`, etc., to check the name that will be used for
the message, in addition to the log level.
2014-10-31 16:48:29 -06:00
Matthew Flatt
65e323d266
make-logger: rescind optional callback argument
...
The optional callback argument was added (by me) in f2d87085
. This is
a backward-incompatible change, but allowing an arbitrary callback
on a logger now seems like an especially bad idea; forms like
`log-error` otherwise work in constrained contexts, while an arbitrary
callback function allows potentially untrusted code in those contexts.
Meanwhile, the addition doesn't satisfactorily solve the original
problem, since it intereferes with `log-level?` and similar filters.
2014-10-31 16:48:29 -06:00
Ryan Culpepper
a02beaa821
check-require: fix submod-related bugs
2014-10-31 15:13:14 -04:00
Robby Findler
73f4fa86a3
Replace the racket/list shuffle function with
...
the fisher-yates shuffling algorithm.
Thanks to Daniel Prager for the push to fix this and doing
most of the work.
The timing tests below seem to indicate that it takes a constant
amount of time per element (about 1/7th of a microsecond per element
on my laptop) and even for 10 element lists it runs faster than
the sort-based version that this code replaces.
Below is some code that I used to explore the shuffles. I used Mike
Bostock diagrams (http://bost.ocks.org/mike/shuffle/compare.html )
to double check that the FY algorithm was implemented properly.
#lang racket/gui
(require pict)
;; some shuffling algorithms:
(define (st-shuffle l)
(sort l < #:key (λ(_) (random)) #:cache-keys? #t))
(define (fy-shuffle l)
(define a (make-vector (length l)))
(for ([x (in-list l)] [i (in-naturals)])
(define j (random (add1 i)))
(unless (= j i) (vector-set! a i (vector-ref a j)))
(vector-set! a j x))
(vector->list a))
(define (naive-swap-random->random l)
(define v (apply vector l))
(define len (vector-length v))
(for ([x (in-range len)])
(define n (random len))
(define m (random len))
(define t (vector-ref v n))
(vector-set! v n (vector-ref v m))
(vector-set! v m t))
(vector->list v))
;; replication of the ``Will it Shuffle?'' diagram
(define green '(0 100 0))
(define red '(165 42 42))
(define (shuffle-pict shuffle size)
(define pict-size 300)
(define sq-size (/ pict-size size))
(define v (build-vector size (λ (i) (make-vector size 0))))
(define ht (make-hash))
(define l (build-list size values))
(define shuffles 10000)
(for ([x (in-range shuffles)])
(for ([x (in-list (shuffle l))] [i (in-naturals)])
(define r (vector-ref v x))
(vector-set! r i (+ (vector-ref r i) 1))))
(apply
hc-append
(for/list ([r (in-vector v)])
(apply
vc-append
(for/list ([e (in-vector r)])
(colorize (filled-rectangle sq-size sq-size #:draw-border? #f)
(triple->color
(sq-color shuffles size e))))))))
(define (sq-color shuffles size n)
(define mid-point (/ shuffles size))
(cond
[(<= n mid-point)
(interp-color red
(- 1 (map-between (/ mid-point 3) mid-point n)))]
[else
(interp-color green (map-between mid-point (* mid-point 3) n))]))
(define (map-between lower-bound upper-bound n)
(cond
[(<= lower-bound n upper-bound)
(/ (- n lower-bound) (- upper-bound lower-bound))]
[(<= n lower-bound) 0]
[else 1]))
(define (interp-color color %)
(define (i n) (- 255 (* (- 255 n) %)))
(list (i (list-ref color 0))
(i (list-ref color 1))
(i (list-ref color 2))))
(define (triple->color triple)
(define (get n) (inexact->exact (floor (list-ref triple n))))
(make-object color% (get 0) (get 1) (get 2)))
(module+ test
(require rackunit)
(check-equal? (map-between 10 110 0) 0)
(check-equal? (map-between 10 110 10) 0)
(check-equal? (map-between 10 110 20) 1/10)
(check-equal? (map-between 10 110 100) 9/10)
(check-equal? (map-between 10 110 150) 1)
(check-equal? (sq-color 1000 10 0) red)
(check-equal? (sq-color 1000 10 100) (list 255 255 255))
(check-equal? (sq-color 1000 10 1000) green))
(define (pictures)
(values
(shuffle-pict st-shuffle 60)
(shuffle-pict fy-shuffle 60)
(shuffle-pict naive-swap-random->random 60)))
;; timing tests
(define (time-it a-shuffler size iters)
(printf "~a ~a ~a " (object-name a-shuffler) size iters)
(flush-output)
(define l (build-list size values))
(collect-garbage) (collect-garbage) (collect-garbage)
(time (for ([x (in-range iters)])
(a-shuffler l))))
(define (timings)
(time-it fy-shuffle 10 100000)
(time-it fy-shuffle 100 10000)
(time-it fy-shuffle 1000 1000)
(time-it fy-shuffle 10000 100)
(time-it st-shuffle 10 100000)
(time-it st-shuffle 100 10000)
(time-it st-shuffle 1000 1000)
(time-it st-shuffle 10000 100))
(module+ main (timings))
2014-10-31 13:26:50 -05:00
Asumu Takikawa
d6b3434cc6
Fix type for window<%> for TR
...
Closes PR 14812
2014-10-31 11:16:03 -04:00
Asumu Takikawa
b7eeaf7608
Fix ordering issue in typechecking inner calls
...
Closes PR 14810
2014-10-30 03:22:09 -04:00
Asumu Takikawa
7829776f72
Add suppport for weak boxes in TR
...
Closes PR 14771
2014-10-30 03:22:09 -04:00
Burke Fetscher
cd00bc0595
redex: keep syntax info for nt aliases
2014-10-29 16:22:19 -05:00
Burke Fetscher
8ffa22dab6
redex: differentiate nts from different langauges
2014-10-29 16:22:19 -05:00
Burke Fetscher
f22d058aee
redex: record nt syntax info for extended language
2014-10-29 16:22:19 -05:00
Stephen Chang
aed26e5178
fix typos in "Building New Contract Combinators" guide
2014-10-29 17:01:58 -04:00
Stephen Chang
ef34c5db01
restore set/c default #:kind to 'immutable; update tests and docs to match
2014-10-29 16:47:58 -04:00
Stephen Chang
40422d35d3
change set/c default #:kind to dont-care, to match docs
...
- add set/c tests
2014-10-29 16:31:25 -04:00
Robby Findler
3d2fdbc8cf
small tweaks to raco show-dependencies
...
- print '#%kernel instead of (quote #%kernel)
- add -l for more human-friendly output that shows direct requires
2014-10-29 09:06:25 -05:00
Ryan Culpepper
e35019d4dc
simplify paths before using as hash keys
2014-10-29 08:54:57 -04:00
Ryan Culpepper
095176736d
db: add empty string test for "text" type
2014-10-29 08:54:57 -04:00
Asumu Takikawa
872e21eff1
Fix/add base-env types for Ref 14.4.3
2014-10-29 01:08:21 -04:00
Leif Andersen
6087d11a36
XFORM_END_SKIP -> XFORM_SKIP_PROC in example.
...
The XFORM_SKIP_PROC example incorrectly used XFORM_END_SKIP,
it should have used XFORM_SKIP_PROC instead.
2014-10-28 20:45:43 -04:00
Robby Findler
e18f8e904f
simplify the drracket/check-syntax documentation a little
2014-10-28 17:10:21 -05:00
Robby Findler
0fa5f866ae
make path->relative-string/library use "<doc>/...." prefixes files in the docs
2014-10-28 17:09:53 -05:00
Robby Findler
54fc2cd939
document setup/main-doc
2014-10-28 17:09:52 -05:00
Robby Findler
fa413f14a9
try to take the autowrap bitmap into account when sizing the repl input box
2014-10-28 17:09:52 -05:00
Robby Findler
00a7eaca2c
adjust the wrap-bitmap-width field to always have an inexact number
2014-10-28 17:09:52 -05:00
Robby Findler
5052e82518
add the get-autowrap-bitmap-width method to text%
2014-10-28 17:09:52 -05:00
Asumu Takikawa
64bc7d4e85
Send thunks to check-syntax for type tooltips
...
This avoids the cost of computing the printed types
to some degree. It still does have overhead (~5%) over
not computing anything related to tooltips because of
the cost of traversing the type table and computing
tooltip locations.
2014-10-28 17:41:58 -04:00
Sam Tobin-Hochstadt
8582d94507
Add implies from typed-racket-lib to unstable-contract-lib.
...
Typed Racket, as of 8ea8c54eb
, can add explicit require lines
to the expanded module, which can confuse the dependency
analyzer. An explicit implies declaration avoids the problem,
although I'm not sure that this is the right solution.
2014-10-28 15:12:32 -04:00
Sam Tobin-Hochstadt
8ea8c54eb4
Avoid requires of contracts when they're not used.
...
This changes when various libraries that provide contract
support to possible contracted bindings to declare when
those bindings are needed.
Probably, each static-contract combinator should manually
add to the list, instead of having one fixed static list,
but this is a start.
Saves about 10ms in startup for an empty TR module on my
laptop.
Thanks to Robby for the idea.
2014-10-28 12:04:49 -04:00
Robby Findler
ed0fa5da5b
another attempt to eliminate references to the original
...
installation directory from the drracket tool docs
please include in 6.1.1
2014-10-28 11:03:42 -05:00
Matthew Flatt
8e34ef3a9d
libffi: fix problems with gcc-4.0 on 32-bit Mac OS X
...
Based in part on https://trac.macports.org/changeset/122079
2014-10-28 08:06:13 -06:00
Robby Findler
01b0c11249
generalize the support for mouseover tooltips so that
...
the computation of the string doesn't have to happen
during macro expansion, but can happen only when check syntax
is in the picture
2014-10-28 08:25:37 -05:00
Robby Findler
6d4b708851
move find-string tests into the wxme test suite
2014-10-28 08:25:37 -05:00
Matthew Flatt
201a5f0e6f
compiler/zo-marshal: allow extflonum literals
2014-10-27 20:01:38 -06:00
Matthew Flatt
35a762b556
remove internal sorted-dirlist
function
...
The result of `directory-list` is now sorted by default, so the
extra function is not needed.
2014-10-27 16:01:49 -06:00
Matthew Flatt
9291726482
racket/file: add make-parent-directory*
...
Also, clarify behavior of `make-directory*` in the case of a relative
path when the current directory does not exist.
2014-10-27 16:01:49 -06:00
Robby Findler
13d7e264c4
fix incorrect interpretation of 'eof in new find-string implementation
2014-10-27 16:38:39 -05:00
Vincent St-Amour
0a8764b470
Add pointer to Sublime Text support.
2014-10-27 15:07:32 -04:00
Vincent St-Amour
c4a09baad8
Move racket-mode to the top of suggested emacs modes.
2014-10-27 15:07:32 -04:00
Asumu Takikawa
d66e0fc3d2
Add deftech for fallback/default methods in docs
2014-10-27 14:32:44 -04:00
Matthew Flatt
2d85fdc02f
libffi: restore some small patches
...
Also, revert file-permission changes.
2014-10-27 11:18:16 -06:00
Gustavo Frederico Temple Pedrosa
9832ad7750
Update libffi to 3.1
...
Update libffi to 3.1 to add support for new architectures.
2014-10-27 11:18:16 -06:00
Robby Findler
df8fef86da
fix a contract example in the documentation
...
closes PR 14798 (the previous commit, 86017992ab
, that
claimed to fix this PR is unrelated; sorry for that)
Please include in 6.1.1
2014-10-27 09:19:27 -05:00
Matthew Flatt
f31c6563e4
make read-line
interruptable on a primitive port
...
Closes PR 14800
Merge to v6.1.1
2014-10-27 07:00:30 -06:00
Matthew Flatt
5eca66acdf
meta/pkg-build: edit the "about" page
2014-10-26 19:00:48 -06:00