Asumu Takikawa
eb90cd4e8c
Add a typed/racket/unsafe library.
...
Comes with `unsafe-require/typed` and `unsafe-provide`.
These operations do not generate contracts but are not
exported by default by Typed Racket.
2015-09-29 18:48:08 -04:00
Georges Dupéron
7f8e91c571
Used new #:context variant (list symbol stx) for the error messages for , as per samth's suggestion.
2015-09-29 18:32:01 -04:00
Georges Dupéron
09d60e003b
Simplified bad syntax error reporting for let (changes c8f02eb
by samth)
2015-09-29 18:32:01 -04: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
Alexis King
4bf3479776
Add types for writeln and println
2015-09-08 15:58:07 -04: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
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
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
AlexKnauth
0ea39a1177
clean up unused definition
2015-08-16 00:00:58 -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
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
Asumu Takikawa
509f1aa20c
Update type for copy-directory/files
2015-08-14 01:02:54 -04:00
Vincent St-Amour
b6362e7eb3
unstable/sequence -> racket/sequence
...
And move to TR one of the functions that didn't make it.
2015-08-13 10:41:15 -05:00
Asumu Takikawa
4f050888e2
Export let*-values from TR correctly
...
Closes PR 14997
2015-08-12 12:16:05 -04:00
Vincent St-Amour
b9268e99db
Move syntax-length to TR.
2015-08-05 13:13:51 -05:00
AlexKnauth
a58c2e317f
add define-new-subtype
...
inspired by haskell newtypes
http://www.mail-archive.com/racket-users@googlegroups.com/msg27118.html
https://www.haskell.org/tutorial/moretypes.html
2015-07-30 01:39:06 -04:00
Brian Lachance
1e5bc30b95
Prevent -let-internal name from leaking to users
...
Because -let-internal wasn't rename-out'd, users would see its name in
syntax error messages. Adding #:context forces the error messages to be
phrased in terms of the given form.
2015-07-29 11:07:54 -04:00
Asumu Takikawa
91279f46c7
Add types for recent functions moved from unstable
2015-07-28 14:49:26 -04:00
Asumu Takikawa
2819a62b30
Add types for new syntax operations
2015-07-27 17:15:54 -04:00
Alex Knauth
f1da9c22c1
Merge pull request #160 from btlachance/colon-checksyntax-arrows
...
Cancel marks for 'disappeared-use ids in colon macros
2015-07-23 16:51:41 -04:00
Brian Lachance
045bf05381
Cancel marks for 'disappeared-use ids in colon macros
...
Fixes check-syntax arrows for the id and optional second :
2015-07-23 14:59:52 -04:00
Sam Tobin-Hochstadt
fca96dcdc1
Quote typecheck-fail-internal
properly.
...
Caught by existing unit tests.
2015-07-20 15:34:49 -04:00
Matthew Flatt
8c006da763
remove syntax-local-make-delta-introducer
2015-07-16 08:40:34 -06:00
Matthew Flatt
2d095c4112
adapt to letrec-syntaxes+values
removal and quote-syntax
extension
...
The `quote-syntax` form now suports a `#:local` option, which is
used for type annotations to preserve binding context.
Since `letrec-syntaxes+values` is now removed by `local-expand`,
some patterns must be adjusted, including the pattern used
for type annotations.
2015-07-16 08:40:34 -06:00
Matthew Flatt
2f00de99d0
declare empty namespace for submodules
...
Using the enclosing module's context for the `#f` part of the
`(module* _ #f ....)` would generally enable a compact encoding of
bindings for the purposes of `module->namespace`. Disabling
`module->namespace` for the generated submodules seems more reliable,
and it seems unlikely that anyone will miss the extra debugging
capability (which is all that is lost for these submodules whose
content is, I think, unspecified).
2015-07-16 08:40:34 -06:00
AlexKnauth
aec5fad4be
make append preserve non-emptyness of first argument
...
see https://github.com/racket/scribble/pull/8#discussion_r33423152
2015-06-28 12:07:42 -04:00
Vincent St-Amour
6bef6e6ca8
Make type of abs
and magnitude
more precise.
...
Fixes a failing test.
2015-06-16 12:00:07 -05:00
Eric Dobson
0498f548c1
Fix the type of abs on negative zeros.
2015-06-16 10:43:01 -05:00
AlexKnauth
e075523e5e
change type of partition
2015-05-19 16:29:49 -04:00
AlexKnauth
b11e48fa93
don't raise error for require/typed in module-begin context
2015-05-14 12:13:14 -04:00
Alex Knauth
c6b1f8fdc0
syntax error for require/typed in untyped code
2015-05-14 12:13:14 -04:00
Eric Dobson
90061c2b96
Add filters for trivial cases in arithemetic procedures.
2015-05-02 08:26:50 -07:00
Eric Dobson
22342d6a35
Simplify flsqrt type.
2015-05-02 08:26:50 -07:00
Eric Dobson
fc4e216fc2
Simplify flexp type.
2015-05-02 08:26:50 -07:00
Eric Dobson
142b52918c
Fix types for flmin and flmax.
...
flmin and flmax only take two arguments.
2015-05-02 08:26:50 -07:00
Eric Dobson
848b69b73d
Simplify flonum comparison types.
2015-05-02 08:26:50 -07:00
Eric Dobson
d288b14244
Expand type of fl/.
2015-05-02 08:26:50 -07:00
Eric Dobson
c50b6291e2
Cleanup fl* type.
2015-05-02 08:26:50 -07:00
Eric Dobson
811cd211e9
Tighten fl+ and fl- types.
2015-05-02 08:26:49 -07:00
Eric Dobson
c3c134780e
Cleanup fx shifts.
2015-05-02 08:26:49 -07:00
Eric Dobson
3c978d82cb
Tighten fxior and fxxor.
2015-05-02 08:26:49 -07:00
Eric Dobson
424658f6ab
Tighten fxmin and fxmax.
...
Replace Zero case with all NonNegative or NonPositive values.
2015-05-02 08:26:49 -07:00
Eric Dobson
93b538b694
Cleanup types of fixnum comparisons.
...
Unify Zero and One cases, and remove extraneous ones.
2015-05-02 08:26:49 -07:00