Commit Graph

4119 Commits

Author SHA1 Message Date
Georges Dupéron
1e99d29be4 Used new #:context variant (list symbol stx) for the error messages for , as per samth's suggestion. 2015-09-16 15:10:42 +02:00
Georges Dupéron
525b04b74e Simplified bad syntax error reporting for let (changes c8f02eb by samth) 2015-09-15 16:50:36 +02:00
Daniel Feltey
c6743b4423 Don't expose require-typed-signature 2015-09-13 04:09:48 -05:00
Daniel Feltey
cbb76b987c Fix tc/letrec-values contract and document require-typed-signature 2015-09-12 13:45:33 -05:00
Daniel Feltey
2ad3dc5f75 Add docs for typed units 2015-09-11 17:30:20 -05:00
Daniel Feltey
93b9390e3b Fix Unit integration tests to match AnyValues in error messages 2015-09-11 15:43:51 -05:00
Vincent St-Amour
f89d91d864 Add timing for contract generation. 2015-09-11 13:39:03 -05:00
Vincent St-Amour
5ed30d7fcf Fix contract build. 2015-09-11 13:12:49 -05:00
Daniel Feltey
2e0cc095c7 Initial support for typed units in typed racket.
Most unit forms are supported, including most of the "infer" forms that
infer imports/exports/linkages from the current context.

Notably, none of the structural linking forms for units are supported, and
`define-unit-binding` is also currently unsupported.
2015-09-10 16:32:11 -05:00
Asumu Takikawa
26c4a199fb Fix accidentally added redundant requires
See last commit
2015-09-09 17:54:09 -04:00
Asumu Takikawa
3d6418b8be Refactor provide handling to reduce code 2015-09-09 12:50:32 -04:00
Asumu Takikawa
2b2e87010a Update version dependency on base
Depends on the rename transformer change
2015-09-09 11:59:43 -04:00
Alexis King
4bf3479776 Add types for writeln and println 2015-09-08 15:58:07 -04:00
Asumu Takikawa
241f04bcdb Fix typed provide uses in some modules
When identifiers provided by typed modules were used in
certain submodules of the form (module* n #f ...) or were
used by modules implemented in a language defined by TR,
the wrong redirection was used in the expansion.

The reason was because TR's identifier redirection decided
whether it was in a typed or untyped context at module visit
time, but that's too early in the cases above.

(because TR's #%module-begin may not have begun expanding yet)

The fix uses a rename-transformer that delays the decision
to use the typed or untyped identifier until expansion time.

Closes GH issue #163 and #181

Closes PR 15118
2015-09-08 15:53:34 -04:00
Asumu Takikawa
552f509102 Refactor the renamer module
Moves `get-alternate` since its only user is the require-contract
module. In addition, it appears that one of the cases in the
conditional in its body is unnecessary. This likely means that
the extra machinery for typed-renamers are not needed at all.

Also adds a test for `require/typed` of a typed module
2015-09-08 13:31:02 -04:00
Vincent St-Amour
fd3941c062 Remove dependency on unstable/contract. 2015-09-07 21:38:22 -05:00
Vincent St-Amour
bdbd18b839 Document AnyValues. 2015-09-07 20:41:05 -05:00
Vincent St-Amour
fbf200c034 Use 2d instead of unstable/2d. 2015-09-07 19:13:50 -05:00
Sam Tobin-Hochstadt
c8f02eb93f Improve error message for (let).
Closes #193.
2015-09-07 17:31:46 -04:00
Vincent St-Amour
a25a07987e Update type of pretty-format. 2015-09-07 15:35:14 -05:00
Brian Lachance
77334808a8 Allow AnyValues as a return type in user code
Closes PR 14217
2015-09-07 13:26:34 -05:00
Vincent St-Amour
9ab862c668 Remove now unused bound-names parameter. 2015-09-07 13:26:07 -05:00
Vincent St-Amour
602223e74a Prevent open SC terms.
Closes PR 15144.
2015-09-07 13:24:16 -05:00
Alexis King
c48abf6dff Fix typo in generated contract for Nonpositive-Integer 2015-08-29 16:41:10 -07:00
Vincent St-Amour
584d01314e Use math/flonum instead of unstable/flonum. 2015-08-27 14:14:51 -05:00
Asumu Takikawa
f5f84c7625 Fix for*/fold and for*/lists
Only parse and use the type annotations if they are present on
all fold variables. This matches the default for other forms in TR.
Also, this will usually result in a "insufficient type information"
message which is more helpful than if TR chose some default type.

Closes PR 15138
Closes PR 14893
2015-08-25 11:44:24 -04:00
Spencer Florence
9fb79b4e18 more missing srclocs 2015-08-22 08:42:14 -04:00
Spencer Florence
1d2da49dfb fixed src loc propigation for n-ary*->binary 2015-08-22 08:42:14 -04:00
Asumu Takikawa
20f3badc98 Enable prefab support correctly for define-struct
I had forgotten to adjust the define-struct macro to work
like the struct macro for the #:prefab keyword, which made
TR think prefabs were ordinary structs.

Closes GH issue #188
2015-08-21 16:38:04 -04:00
Asumu Takikawa
51cd8db3d6 Add types for a few missing syntax functions
Also fix some existing types
2015-08-20 17:08:47 -04:00
Spencer Florence
c8ebec62e8 fixed unbox-let optimization srcloc propigation 2015-08-20 15:20:51 -05:00
AlexKnauth
30cdfd16cc print more Error types as Error types 2015-08-17 17:48:00 -04:00
Asumu Takikawa
d4a9052f52 Fix outdated comment for redirect-contract 2015-08-17 13:12:25 -04:00
AlexKnauth
10c85f911a don't export Distinction 2015-08-17 01:08:07 -04:00
AlexKnauth
09203307cb test docs-complete on Travis CI 2015-08-17 01:08:07 -04:00
AlexKnauth
0ea39a1177 clean up unused definition 2015-08-16 00:00:58 -05:00
AlexKnauth
0037a0277f allow values with define-new-subtype types as functions 2015-08-15 19:00:35 -05:00
AlexKnauth
efb877dbfb fix inference with define-new-subtype 2015-08-15 14:36:45 -05:00
AlexKnauth
af2c22f542 Add error message specifications 2015-08-14 21:42:21 -05:00
AlexKnauth
f8cc9e8dcd fix issue #169 2015-08-14 21:42:20 -05:00
Asumu Takikawa
dfdf86e527 Add identifier-binding-symbol to TR base-env 2015-08-14 21:25:54 -04:00
Asumu Takikawa
2e97280335 Eliminate the eval hack for top-level structs
This eliminates a hack used to make the `struct` form
work at the TR top-level. The trampolining top-level
typechecker makes this unnecessary.
2015-08-14 21:25:54 -04:00
Asumu Takikawa
d85a267c42 Declare require/typed internal identifier first
Uses the `define-syntaxes` trick to declare the identifier
so that its binding symbol doesn't change later.
2015-08-14 21:25:54 -04:00
Asumu Takikawa
e031d6c47e Typecheck the top-level using trampolining macros
Instead of local-expanding the entire top-level forms at
once, wrap expressions in a top-level begin in trampolining
macro forms. This allows the typechecker to trampoline back
to the evaluator, which is necessary to declare/register
declarations made in a top-level begin.

The point of this change is to eliminate top-level hacks
and faciliate various macros that need to communicate using
multiple top-level forms.
2015-08-14 21:25:54 -04:00
Asumu Takikawa
84bd502d46 Refactor TR top-interaction
Use a macro to abstract out the implementation of most
of the top-level TR commands.
2015-08-14 21:25:54 -04:00
Asumu Takikawa
94ce4b203e Use tc-expr for top-interaction functions instead
This restricts operations like `:print-type` to only
work on expressions. This seems like a reasonable
restriction and simplifies the implementation.
2015-08-14 21:25:54 -04:00
Vincent St-Amour
e997f02095 Rewrite compound pair operation optimization.
Previous version replaced calls to, e.g., `cadr` with calls to `cdr`
then `car`, called the typechecker to populate the type table, then
optimized the exploded operations. The call to the typechecker failed
on open terms, limiting the applicability of the optimization, and was
just generally brittle.

The new version instead explodes operations, then optimizes them inside
out for as long as the argument's type guarantees it's safe. This works
on open terms, and should be more robust.
2015-08-14 17:28:47 -05:00
Sam Tobin-Hochstadt
c5a75df00c Merge pull request #176 from racket/sudo-false
Try running travis on docker.
2015-08-14 10:11:58 -04:00
Sam Tobin-Hochstadt
5716a850f1 Try running travis on docker. 2015-08-14 09:40:23 -04:00
Asumu Takikawa
509f1aa20c Update type for copy-directory/files 2015-08-14 01:02:54 -04:00