Commit Graph

45 Commits

Author SHA1 Message Date
Vincent St-Amour
a6d5a98b61 Include NaN in all floating-point types.
Makes more closure properties hold, but weakens occurrence typing for
some comparisons involving flonums.
2012-08-03 14:21:44 -04:00
Sam Tobin-Hochstadt
4a90c6c1fe Ensure that structs don't overlap with simple values.
Reported by Ray Racine.

Please merge to release.
2012-07-20 13:01:32 -04:00
Eric Dobson
3dfd4c52a9 Fix bad contract and clashing provides in TR when contracts are enabled. 2012-07-15 19:21:25 -04:00
Eric Dobson
030e56311e Make TR compile cleanly with contracts enabled.
Added a couple of contracts and fixed some others up as well.
The two bugs were that with-contract was not imported, and that
subtype could be called with Values and Results.
2012-07-15 19:21:11 -04:00
Sam Tobin-Hochstadt
9e097866bf Vector fixes.
- Allow indexing into a VectorTop, with result `Any`.
- Don't use special typing rules for applications when the operator
  has an annotation or instantiation.

Closes PR 12887.
Closes PR 12888.
2012-07-14 21:30:26 -04:00
Sam Tobin-Hochstadt
418a0c311b Print StructTop nicely.
Related to PR 12903.
2012-07-14 18:41:42 -04:00
Sam Tobin-Hochstadt
4cba6e010f Intern Struct types properly wrt. identifiers. 2012-07-13 17:10:50 -04:00
Sam Tobin-Hochstadt
683f8e4e4b Use promises for current-type-names. 2012-07-13 17:10:50 -04:00
Sam Tobin-Hochstadt
396b04eb86 Reduce some dependencies of Typed Racket prims. 2012-07-12 17:41:12 -04:00
Sam Tobin-Hochstadt
6bf141513f Revise type environment propagation to use submodules.
Each typed module now defines a submodule named `type-decl`.
This module performs the type environment initialization (along
with other environment updates) when invoked.  Additionall,
every typed module, when invoked, performs a for-syntax addition
to a list specifying the submodules that need invocation.
This invocation is then performed by the `#%module-begin` from
Typed Racket.

The `type-decl` module always goes at the beginning of the
expanded module, so that it's available at syntax-time for all
the other submodules.  This involved adding pre- and post-
syntaxes for the results of typechecking.

This allows significant runtime dependency reduction from the
main `typed/racket` and `typed/racket/base` languages (not yet
complete).
2012-07-10 12:49:27 -04:00
Neil Toronto
419b59e88e Added inline hint around `index?' definition; my own timing suggests 2x speedup 2012-07-09 19:15:35 -07:00
Sam Tobin-Hochstadt
20e95f8d8e More refactoring and reduction of runtime dependencies. 2012-06-28 14:34:07 -04:00
Sam Tobin-Hochstadt
f075ecd36e File splitting, dependency reduction. 2012-06-28 14:34:07 -04:00
Sam Tobin-Hochstadt
94f1cb2127 Avoid requiring the printer unneccesarily. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
c61ed30d0b Depend only on the lowest-level place primitives. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
794bfa50ec Load environments dynamically in residual code. 2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
88ff5fee69 Minor refactorings.
- Remove tracing requires.
 - Use lists instead of sets in a few environments.
 - Small cleanups.
2012-06-25 18:07:45 -04:00
Sam Tobin-Hochstadt
a05acfee4c Split out some small utilities to prepare to reduce dependencies. 2012-06-25 14:10:18 -04:00
Sam Tobin-Hochstadt
ccb724155a scheme -> racket 2012-06-25 13:39:07 -04:00
Neil Toronto
8f840bd07b Fixed erroneously imprecise type for +nan.f literal (now Single-Flonum-Nan)
Types for nan?, infinite?, pi.f, exact-round, exact-floor, exact-ceiling,
exact-truncate, degrees->radians, radians->degrees

Extended tc-random-testing: generates exact integers and rationals now

Fixed types of sinh, cosh and tanh to account for underflow and NaNs
2012-06-09 17:46:04 -06:00
Sam Tobin-Hochstadt
865a2cdcbd Support definitions of keyword functions in Typed Racket.
Caveats:
 - keyword function definitions do not define static
   bindings, thus limiting optimization opportunities
 - can't use `define:`, `lambda:`, etc with keywords
 - error messages sometimes expose the implementation
 - the optimizer skips most of the generated code for
   keyword functions definitions (user-level code is
   optimized)
2012-06-02 18:22:07 -04:00
Sam Tobin-Hochstadt
c8380b94e5 Remove testing code, and failed experiment. 2012-06-01 20:08:37 -04:00
Sam Tobin-Hochstadt
a377c42357 Use the new syntax properties for checking keyword functions.
Previously, some hacks were used to obtain the internal
identifiers that implemented keyword functions directly, and
give them types at startup.  Now, the primary "function"
(eg, `sort`) is given a type, and when used, the residual
syntax properties are used to find `sort` from the real
functions, and then the type of the real function is computed
from the type of `sort`.

Some creativity was required in the types of functions which
take optional arguments that when present, alter the return type,
such as `regexp-match*` and `file->list`.
2012-06-01 18:37:02 -04:00
Eric Dobson
262ecc3da9 Redefine Boolean as (U #t #f).
Closes PR 12815.
2012-06-01 10:26:10 -04:00
Vincent St-Amour
ebcc6d211a Fix handling of NaN and infinities.
Most of these were found through random testing.
2012-05-25 17:15:22 -04:00
Eli Barzilay
6318df82e5 Drop the now-redundant " " argument from existing uses of `string-join'. 2012-05-24 10:40:20 -04:00
Eli Barzilay
17090fca4f A bunch of fprintf' -> eprintf' conversions (and a few related things). 2012-05-06 12:06:00 -04:00
Vincent St-Amour
8cbd26899f Include both float zeroes in Non-Negative and Non-Positive types.
Closes PR12706.
2012-04-16 17:51:04 -04:00
Sam Tobin-Hochstadt
1abb027fc7 Fix Typed Racket build with contracts enabled. 2012-04-06 10:24:49 -04:00
Sam Tobin-Hochstadt
678941ce5a Pass temporary value for Un' along in recursive call in substitute'.
Closes PR 12600.
2012-02-24 20:25:53 -05:00
Sam Tobin-Hochstadt
99f01f5260 Fix overlap with sequences. 2012-02-20 15:09:51 -05:00
Vincent St-Amour
87a53159dd Union types instead of clobbering them in the type table.
This fixes a bug where only the last branch of a case-> type would get stored.
2012-01-13 11:28:36 -05:00
Sam Tobin-Hochstadt
f23baef8aa Opaque types may overlap with anything.
Closes PR 12434.
2011-12-09 18:11:51 -05:00
Sam Tobin-Hochstadt
c55cceed8c Two types definitely overlap if they are equal.
Fixes infinite loop in Whalesong compilation.
2011-09-16 17:20:31 -04:00
Eli Barzilay
623c7493ed Some selective #:when (not ...)' -> #:unless ...'. 2011-09-16 10:48:18 -04:00
Vincent St-Amour
7e9e500818 Fix case-lambda type printing.
Closes PR 12188.
2011-09-13 15:42:04 -04:00
Vincent St-Amour
8ae1a903fa Compare numeric unions using a linear scan. 2011-09-13 11:22:24 -04:00
Vincent St-Amour
c63b5873e3 Optimize subtyping of numeric types. 2011-09-13 11:22:24 -04:00
Vincent St-Amour
40456b4fd8 Add a field to base types to indicate if they are numeric types or not. 2011-09-13 11:22:24 -04:00
lvilnis
80ece9023a Fixed a bug where predicates would sometimes fail to match 0.0 2011-09-09 12:10:58 -04:00
Eric Dobson
c62f09ac5b Fixed subtyping for StructTop. Closes PR11099. 2011-09-07 09:17:04 -04:00
Eric Dobson
32becc2e0a Change overlap for structs in TR. Closes PR11390. 2011-09-07 09:17:04 -04:00
Eric Dobson
53ce20d3f9 Resolve names in overlap in TR. Closes PR11392. 2011-09-07 09:17:03 -04:00
Sam Tobin-Hochstadt
64a1aee65d Whitespace fixes, small optimizations of union cases. 2011-09-06 11:14:57 -04:00
Sam Tobin-Hochstadt
d2e1cc02dc Move typed-scheme to typed-racket collection.
Compatibilty typed-scheme collection left.
2011-09-03 20:49:39 -04:00