Commit Graph

32484 Commits

Author SHA1 Message Date
Neil Toronto
cd293eb379 Allow plots with 0-length axes
Closes PR 14053
2014-04-05 20:05:09 -06:00
Robby Findler
c8f3974a20 avoid calling pkg-directory so much
by making the assumption that pkg-directory's results
(for a given input) don't change within a since "Run"
in DrRacket
2014-04-05 20:56:36 -05:00
Matthew Butterick
481d19fbdd missing semicolon in Scribble CSS 2014-04-05 19:25:06 -06:00
Matthew Flatt
40027e8b1d pkg/path: fix for when the argument = a pkgs install directory 2014-04-05 16:40:43 -06:00
Matthew Butterick
7a1fe139a5 further dehackify .toptoclink style in Scribble CSS 2014-04-05 16:30:35 -06:00
Matthew Flatt
5193e37f0b racket/gui cocoa: toolbar-button is for 10.6 and earlier, only
In particular, 'toobar-button (before 10.7) and 'fullscreen-button
(10.7 and later) do not get along, so use only one of them.
2014-04-05 16:26:31 -06:00
Neil Toronto
32374df556 Create plot frames in current eventspace; fix plot snip resize override
As suggested by Robby and Eli here:

  http://lists.racket-lang.org/users/archive/2013-March/056771.html

both `plot-frame' and `plot' (when `plot-new-window?' is #t) now create
frames in the caller's eventspace. Doing so fixes the problem talked
about in that thread, and seems like good behavior overall.

Plots created a separate eventspace because of the issue raised here:

  http://lists.racket-lang.org/users/archive/2012-April/051485.html

in which a user was flummoxed by the fact that framed plots don't draw
during read loops in which events can't be processed, and the suggested
solution wasn't easy or obvious. Users may get Plot's old behavior by

  (parameterize ([current-eventspace  (make-eventspace)])
    (plot ...))

which, though still not obvious, is at least easy.

Related to PR 13535: from the user's feedback, plots having their own
eventspaces may cause framed plots to render at the wrong size
initially, and may partly cause them to not redraw when their frame
is resized. Hopefully the eventspace change fixes one or both
problems.

If not, maybe this will: 2d-plot-snip% and 3d-plot-snip%, which
descend from image-snip%, now properly call the superclass method
within their `resize' overrides, so their editors will be notified
of the change and hopefully redraw them.
2014-04-05 16:04:47 -06:00
Neil Toronto
f939725950 Fix internal lock issue in snip canvas by wrapping erase+insert in an edit sequence 2014-04-05 14:07:44 -06:00
Neil Toronto
6a73b6b9ec Fix wrongly raised exception when 3D rectangles are entirely clipped out 2014-04-05 11:47:32 -06:00
Neil Toronto
f00da37186 Remove redundant tests; speeds up contour plots by about 15% 2014-04-05 11:47:32 -06:00
Neil Toronto
1f60dbf57e Currency tick formatting: round before splitting into whole and fractional parts
Fixes erroneous formatting of numbers close to whole numbers; e.g.
0.9999 used to be formatted as "$0.00".
2014-04-05 11:47:32 -06:00
Robby Findler
66c5ac2904 enable fullscreen for drracket in mac os x 2014-04-05 11:54:50 -05:00
Matthew Flatt
cc26a86cb1 scribble manual style: remove toc hack
At mbutterick's recommendation:

 it's causing a strange display problem in TOC listings when the
 cursor is hovering over the link (namely, the underlined space
 dangling from the right edge)
2014-04-05 08:07:48 -06:00
Matthew Flatt
bd1dafdd17 fix package dependencies of "typed-racket-doc" 2014-04-05 08:04:31 -06:00
Matthew Flatt
15630b5245 avoid compiler warning 2014-04-05 07:31:58 -06:00
Matthew Flatt
6d54632319 places on Windows: fix OS thread identification
The bug particularly broke `#:async-apply` handling for an FFI callback,
causing the current thread always to be equated with the target thread.
For example, the teachpack documentation (which now renders images
to SVG) kept crashing on a multi-place build due to callbacks getting
invoked in the wrong place.
2014-04-05 07:13:28 -06:00
Matthew Flatt
c18f6e8d6d racket/draw: fix memory-management problem related to PDF/SVG callbacks
It's not clear that there's actually any path from the adjusted calls
to the PDF/SVG bytes-writing callback, but in principle, arguments
to Cairo and Pango calls must not be moved by the GC.
2014-04-05 07:13:27 -06:00
Matthew Flatt
b065d1f868 ffi/unsafe: add #:malloc-mode to define-cstruct and _list-cstruct 2014-04-05 07:13:27 -06:00
Matthew Flatt
887a906bd2 racket/gui: add Mac OS X fullscreen options to frame% 2014-04-05 07:13:27 -06:00
Robby Findler
a205cb2d0c fix bug in val-first version of or/c
It didn't follow the val-first protocol properly and
ended up losing the neg party
2014-04-05 07:38:19 -05:00
Eric Dobson
c4f497bf2b Remove a special case for NoFilter/NoObject in check below. 2014-04-04 21:25:49 -07:00
Eric Dobson
beb981e2af Add support for poly dotted types below tc-any-results. 2014-04-04 21:22:32 -07:00
Eric Dobson
ec14598ad8 Add value-mismatch to check-below, and fixup some poly dotted cases. 2014-04-04 21:22:32 -07:00
Neil Toronto
1938928a44 Use sequence/c's #:min-count for better error messages in `lines' and others
Closes PR13709
2014-04-04 21:43:48 -06:00
Neil Toronto
191ed1cedd Replace `in-cycle' with a version that checks for emptiness and doesn't loop forever
Closes PR13620
2014-04-04 20:54:59 -06:00
Neil Toronto
d687865556 Documented typed/untyped-utils 2014-04-04 19:02:45 -06:00
Robby Findler
b23f7fe95f add missing for-label require 2014-04-04 16:45:33 -05:00
Robby Findler
8fb8f561c4 adjust 2htdp/image so that they work properly as wxme-mode snips
Before, they would create a crippled version in that mode, but
that is no longer necessary (it may never have been necessary,
but it certainly hasn't been necessary in a while)
2014-04-04 16:45:32 -05:00
Burke Fetscher
34de786970 Preliminary logging for the benchmark.
Currently, just write all the stuff that was previously
being printed to a log file.
2014-04-04 15:53:19 -05:00
Vincent St-Amour
a21caa361c Optimize fx->fl when safe. 2014-04-04 14:57:02 -04:00
Vincent St-Amour
e0a0c5f999 Make locating dot executable more robust. 2014-04-04 14:57:02 -04:00
Neil Toronto
a7eba53efc Removed all flonum speed hacks; plots are usually no slower and are sometimes faster now
In an ultimately vain attempt to make plotting fast but still allow
plots with bounds that have very few flonums in them, Plot used to try
to detect when each axis's bounds had enough flonums in it and switch to
flonum-only math. There are two problems with this:

 * It was trying to determine whether *future computations* would have
   enough precision, which is very difficult to know for sure, so it
   only *usually* worked. (Example fail: contour-intervals3d with 0 and
   +max.0 endpoints. Half the isobands weren't drawn.)

 * It caused extra conversions between flonums and exact rationals,
   which are very slow.

Here's the new approach:

 1. Always send exact rationals to user functions (e.g. the lambda
    arguments to `function' and `contour-intervals3d').

 2. Immediately convert user-given plot coordinates to exact
    rationals (if rational; e.g. not +nan.0)

 3. Always represent normalized coordinates (e.g. in [0,1]^2 for 2D
    plots and [-1/2,1/2]^3 for 3D plots) using flonums.

 4. Reduce the number of exact operations as much as possible.

IOW, plot coordinates, which can be incredibly huge or tiny and don't
always fit in flonums, are always exact internally. Normalized, view,
and device coordinates, which are used only internally, always have
bounds with plenty of flonums in them, so Plot uses flonums.

Doing #4 accounts for most of the changes; e.g. to the marching
squares and marching cubes implementations, and axial plane clipping.

Most plots' speeds seem to be unaffected by the changes. Surfaces and
contour intervals are sometimes faster. Isosurfaces are a tad slower
in some cases and faster in others. Points are about 50% slower,
partly undoing the speedup from a recent commit. Plots with axis
transforms can be much slower (4x), when long, straight lines are
subdivided many times. Plots with bounds outside flonum range seem
to be about 3x faster.
2014-04-04 12:04:49 -06:00
Matthew Flatt
8abf78256a add racket/undefined
The `(letrec ([x x]) x)` pattern for getting the undefined value will
cease to work in a near-future version of Racket (ater
v6.0.1). Instead, the initial refernce to `x` will produce a "variable
used before its definition" error.

For libraries that need an "undefined" value, this new library
provides `undefined`, and the library will continue to work in future
Racket versions.

The library also provides a `check-no-undefined` operation that
normally should be wrapped around an expression to keep it from
producing `undefined`. For example, the class system initializes
object fields with `undefined`, but it could (and will, eventually)
wrap each access to a field within `class` to check that the field's
value is not `undefined`.
2014-04-04 10:07:08 -06:00
Matthew Flatt
1d8cfea1fc ffi/unsafe: add _stdbool 2014-04-04 09:57:42 -06:00
Robby Findler
3b030e393d adjust the dns tests so they stop failing
also, remove eli-tester use since I got bit, yet one more time,
by the "syntax error on both sides of the => implies the test case
passes" behavior.
2014-04-03 11:35:59 -05:00
Eric Dobson
6b0676ef2b Make it so that handlers lookup arrities other than the first.
Fixes current build breakage.
2014-04-03 09:29:33 -07:00
Matthew Flatt
1cda4e4f83 meta/new-web: fix #:html-only? keyword arguments 2014-04-03 07:16:51 -06:00
Matthew Flatt
120d17fccc fix makefile for MinGW cross-compile 2014-04-03 07:16:50 -06:00
Neil Toronto
efc46ded6d Changed PDF/PS backend to use 1.0 x 1.0 scaling
This makes plotting to a file the same (well, with slight differences)
regardless of file format. Scaling and other PS options are controlled
by a `plot-ps-setup' parameter. Not sure how useful that is, yet, so
it's undocumented.
2014-04-02 23:20:22 -06:00
Neil Toronto
c1550b673b Remove unnecessary use of `remove-duplicates' 2014-04-02 23:20:22 -06:00
Eric Dobson
87cfce97f9 Add a bunch of new check below tests. 2014-04-02 21:45:02 -07:00
Eric Dobson
bddd7a1b53 Add contracts to filters. 2014-04-02 20:58:36 -07:00
Eric Dobson
448c66a7a8 Make open-Result not incorrectly close over rest and keyword arguments. 2014-04-02 20:58:36 -07:00
Eric Dobson
d29df205f7 Make exception handlers smarter about opening the result. 2014-04-02 20:58:19 -07:00
Burke Fetscher
34c3eed615 Add script to find good p-values, adjust models.
The definition of good at this point is that
the average is close to the maximum counterexample
size.
2014-04-02 12:37:56 -05:00
Neil Toronto
3d2a9794b4 Fixed error in drawing connected lines with axis transforms 2014-04-02 11:35:17 -06:00
Neil Toronto
04b49bcdd1 Reduce point3d rendering time by 50-70% by keeping points grouped
The old depth sort hack split up groups of identical points in order
to sort them. Now the BSP tree build keeps them grouped, only splitting
groups of points as needed. Drawing parameters like color and pen
width are set only once for each group instead of once for each point.
The speedup is from reducing the number of calls to set them.
2014-04-02 11:14:12 -06:00
Neil Toronto
e05ec03a6d BSP tree type simplified; added support for no-polygon scenes
Previously, the BSP type had a "negative" and "positive" subtree, and
a collection of unsorted "zero" (on the plane) shapes. Rather than "zero"
being a subtree (which would sort the shapes), it's rolled into "positive",
with corresponding changes to the BSP walk.

BSP tree build now supports scenes without polygons, though it does split
on polygonal planes first. When all such splits fail (usually because there
are no polygons, but might be because all the shapes lie on one polygon's
plane), it tries splitting on planes containing line segments. When that
fails (usually because there are no line segments), it tries splitting
disjointly on all remaining vertexes, then splitting at the midpoint of
the longest axis.

Upshot: it'll draw a double helix created by two `parametric3d' renderers
properly.
2014-04-02 11:14:12 -06:00
Neil Toronto
530d8c16a0 Faster, more precise detection of separating hyperplanes in BSP tree build
The new method finds bounding planes for polygons using their
(approximate) normals and works for any number of them instead of
just two. The algorithm is O(n^2) where n is the number of polygons,
so it is currently applied only when n <= 5; i.e. near the leaves.
2014-04-02 11:14:12 -06:00
Burke Fetscher
f4ce391fab print out check's input on exceptions 2014-04-02 10:27:24 -05:00