Commit Graph

3256 Commits

Author SHA1 Message Date
Asumu Takikawa
a91d41a453 Fix inheritance without expected type
original commit: c16a3b2350530c1858dacb8d1b7ea70fc42f1081
2014-02-20 16:50:22 -05:00
Asumu Takikawa
e54413e95a Set init arguments as optional correctly
original commit: d8a303983024a416be66b69f060270d2b39d4bb5
2014-02-20 16:50:22 -05:00
Asumu Takikawa
f4c8fd57e0 Make internal/external names work
original commit: f895e3156f26d01a5c62c18d675514204440f9ff
2014-02-20 16:50:22 -05:00
Asumu Takikawa
21b9774043 Better class types when no expected type given
original commit: ae2866e8ca7eb1c7822bb71518bd5db9adc95dfa
2014-02-20 16:50:22 -05:00
Asumu Takikawa
06c9398293 Fix top-level use of classes
original commit: 2ae1f5a602f843f9c854de9809916a60ff767cc5
2014-02-20 16:50:22 -05:00
Asumu Takikawa
59a5c57f42 Type-check class top-level expressions
original commit: dc35a8cd4db8f2a0cf9424aac50aad7960eb1074
2014-02-20 16:50:22 -05:00
Asumu Takikawa
4356293a59 Support tc-expr and not just tc-expr/check
Note: the type is too conservative in some cases with
      tc-expr (if you leave : annotations out). This should
      be fixed in the future.

original commit: 6a43fac5c27d46f1bb456e861f55c4b2dddca455
2014-02-20 16:50:22 -05:00
Asumu Takikawa
2ee160cc8c Add infrastructure for private methods
They don't actually work yet, because I don't yet know
how to assign them types for when they're called locally.
Probably requires the two pass approach for locals.

original commit: 709f3c66960fc08b77a7978c7c64ddb3e27b4c45
2014-02-20 16:50:22 -05:00
Asumu Takikawa
d1ae0dc0e9 Add support for local field access
original commit: 6c0e82f15bc1dda5b984d4ddf21c41de9eb80315
2014-02-20 16:50:22 -05:00
Asumu Takikawa
28096a6385 Add support for override
original commit: 931556264e4fea7c1c3e5f289aade11e511c60d4
2014-02-20 16:50:22 -05:00
Asumu Takikawa
f028ab23b3 Check super-new calls
Still need to use this information to adjust the class
type init clauses

original commit: 060aaa8b26c05ca8800db0d3444b5f4c4a09bf4f
2014-02-20 16:50:21 -05:00
Asumu Takikawa
f058d684b6 Add unit tests for classes
original commit: 77847de94436dcaf8389236d14251110fa7c138a
2014-02-20 16:50:21 -05:00
Asumu Takikawa
bc07b8b140 Initial work on type-checking class expressions
Add a `class:` macro that adds instrumentation for
the type-checker. Also add type-checking for the
expansion of that macro.

original commit: 244135a96e8c6e98e6a77052813b53d4f284443f
2014-02-20 16:50:21 -05:00
Asumu Takikawa
744c8593d6 Clean up object init and add support for get-field
original commit: 684fabde1bdfa92279c413ab612f2771db2f2f9e
2014-02-20 16:50:21 -05:00
Asumu Takikawa
68518c74fc Add new Class type representation
This commit introduces a new Class type representation
and adds initial support for parsing the new types.

Existing uses of Class types are adjusted to compile.

original commit: 72c991c1de2ad964657883422d18cea3f6429eb2
2014-02-20 16:50:21 -05:00
Asumu Takikawa
ecc82246af Make TR's for/hash form more flexible
original commit: d35fb82f4a583a6b27164ecd92fd8d52c0dd72db
2014-02-20 14:13:41 -05:00
Asumu Takikawa
9a4ee81604 Add TR case-lambda with optional type annotations
original commit: 58a3d12f0c1e27b2ea45bcb1c8ee1243825d28b1
2014-02-20 13:54:32 -05:00
Asumu Takikawa
4216d01b2d TR: move helper syntax classes to helper file
original commit: ed98404aafea1f9d0142dabdba73dcf7f16dda73
2014-02-20 12:05:11 -05:00
Asumu Takikawa
f57a8f5e96 Add test for PR 13937
The actual bug was already fixed by enabling multi-valued
sequence syntax in TR `for` loop forms.

Closes PR 13937

original commit: 8d4b3ee396a645a828594b7b9afdcaf7e5676ccd
2014-02-20 00:06:45 -05:00
Asumu Takikawa
9ee89f821d Document legacy forms with a : suffix
Also don't export internal macros

original commit: a17e4578404b7eb243e1b7dbfb749b1df6e44215
2014-02-19 21:20:48 -05:00
Asumu Takikawa
43060c8d37 Revise TR Reference for new :-less forms
original commit: 768d04fa975097097af18d2fae1be108cbf3abbe
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4f2bd7180f Provide :-less versions of all for forms.
Modify the forms as needed to accept non-annotated
bindings to match the untyped versions. Also fixes
bugs in syntax classes found along the way.

original commit: 37b09521ac3493ed45963aedacf7a263194aec1a
2014-02-19 16:40:40 -05:00
Asumu Takikawa
28cba9af4a Accept polydots rest in TR lambda and define
Also accept type variables before formals in all cases

original commit: 35ef2f90ebef94c8f7c4e46fc43c03b6ce329a41
2014-02-19 16:40:40 -05:00
Asumu Takikawa
088e5d700f Enable mixed type annotations for define
original commit: 3d177e454ea3634060a4b9b0814f588bc7c74e49
2014-02-19 16:40:40 -05:00
Asumu Takikawa
5cfd64eb33 Support polymorphism in both TR let and lambda
original commit: 967490cb229c3ef4d70960f6b0075d8e28f21ea9
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca951c418c Add :-less versions of struct macros
original commit: 45d36579d3823f024a7448ed9efc552aa90b9b0f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
861d303db5 Add a :-less do for TR
original commit: a941f95c2e117829b729d75f815c868630a5869f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
b5f3811937 Make :-less versions of let variants in TR
original commit: e6e3ab4e74f95585d01ae66df048ee6ee76088b1
2014-02-19 16:40:40 -05:00
Asumu Takikawa
6ffd6fc72c Add support for rest arguments in TR plain lambda
Two caveats:
  * in some positions : is not accepted as a formal
    when used in combination with * as a formal
  * the quality of parse error messages for rest
    argument types is traded for better optional argument
    error messages

original commit: a3d818c748b09dd07043460ad412a19d0f94b47c
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca0c7f3f35 Better error messages for TR lambda parsing
original commit: ad4f6e1ea1f9c0e2e7ca30e6ea6d8c6e8a50f0ca
2014-02-19 16:40:40 -05:00
Asumu Takikawa
f1fbe180e2 Incorporate PR feedback
original commit: aef37edae4fdeea89960bdaff6abe7d474e91218
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ad79633b49 Improve type-checker for optional arg functions
original commit: eb7a0f87974f9bdeba8819cfbd7899773eae019b
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4338551c6c Allow TR lambda to have a result type annotation
original commit: 7e09362986ea09bcfd68894c83331ecc0ca7cee4
2014-02-19 16:40:39 -05:00
Asumu Takikawa
91b02494df Improve TR lambda to accommodate type annotations
The new `lambda` form allows all combinations of arguments
with optional type annotations for all cases.

original commit: 8ea32c68f61a0bfad6b162302bc3c0ff28870361
2014-02-19 16:40:39 -05:00
Asumu Takikawa
5b642ef79d Fix TR double cast bug
In some cases, TR tried to typecheck the contents of a quote-syntax
form that contains unexpanded syntax.

Closes PR 14355

original commit: 26204cf505f885827854908391d2842476728c8b
2014-02-18 23:28:49 -05:00
Asumu Takikawa
1fecbdb182 Add typed/pict which exports part of pict
Does not cover all of the bindings yet, but it
should just be a SMOP after the last extra-env-lang
feature additions.

original commit: 0c0befac075a137158c568f93397c9bea4a109b2
2014-02-18 18:43:57 -05:00
Asumu Takikawa
c8595e7e45 Improve TR's extra-env-lang
Instead of parsing the module's body like env-lang,
export a `type-environment` form instead. That way
the module may contain any auxiliary definitions
or expressions that are needed.

Additionally allow #:opaque and #:struct clauses
for opaque and struct types in the base type environment.

Update typed/syntax/stx for the new API.

original commit: db51fdb8fdc943971122fea32a7b593b187bd685
2014-02-18 18:43:57 -05:00
Vincent St-Amour
1b78da2bf6 Swap remaining unsafe and chaperone-unsafe operation in the TR optimizer.
Fixes the fix in aba046a92d42.

original commit: 1d1d8bacad035fc1609f7444dd207a92b395d5ae
2014-02-17 18:41:18 -05:00
Asumu Takikawa
720544b95c Improve type inference for ListDots
This provides better inference for the case when trying
to infer a ListDots in a negative position against a List
type. For example, when trying to apply `time-apply`.

original commit: 18adcb5b041be12994eb65d86bde5dc1f164cca7
2014-02-16 11:35:55 -05:00
Asumu Takikawa
08e8a6eeb1 Fix TR regression and use abstraction recipe
A function like (lambda (x) (lambda (y) y)) would cause TR
to fail in an internal metafunction. The fault was triggered
when the object y is abstracted to (0 0) and then the outer
lambda tries to abstract (0 0) and fails.

The problem was triggered by the new path index changes in
v6.0 because TR did not previously try to abstract objects
that occurs in the target type (now necessary for scope
lifting of path indices), which may contain non-identifier
objects.

This error didn't occur in another nearly identical (except
for one crucial identifier? check) code path, so this commit
also eliminates the duplication by abstracting.

original commit: bf47523ac92f2d3b32e6c97aa83d9d256b449a6f
2014-02-15 00:14:47 -05:00
Asumu Takikawa
fae843b628 Update TR doc pkg dependencies
original commit: d32e0eda7cd18b6c61d68a224a8f35a91fce2b15
2014-02-14 19:15:42 -05:00
Asumu Takikawa
055caf7d7b Add a top blurb to the TR Reference
original commit: 6fd39d78d74ec66bb97ce18110e279e151c42e8d
2014-02-14 17:33:02 -05:00
Asumu Takikawa
0e9e628d79 Add a TR Guide section about ->* and optional args
original commit: a9b09f29103339a761c0a158a8ae0e409f74ab0c
2014-02-14 17:24:23 -05:00
Asumu Takikawa
54458fdb51 Use prefix -> in the TR Guide examples
Also some minor fixes like using the more common
case-> form rather than case-lambda.

original commit: 1c5f6714a878dca04c2a0f392733993bb4425a2b
2014-02-14 17:12:36 -05:00
Asumu Takikawa
0150e379f2 Add diagrams from Vincent's PADL paper to TR docs
original commit: f59a122841a15748a7be4c4128ef2793a2a3bcd4
2014-02-14 16:38:31 -05:00
Asumu Takikawa
f42081cca9 Reorganize documentation for -> form in TR
Put examples next to relevant prose, add more examples,
and add more cross-references.

original commit: 6ad1af3741fbdbdc5796ee7db07f42550ac7677f
2014-02-13 13:21:02 -05:00
Asumu Takikawa
0d51c5aa2c Fix TR reference typo
original commit: 4b580a8b8dd3a5920b55cdb8f394d710b5945de0
2014-02-13 01:34:51 -05:00
Asumu Takikawa
8487bf8485 Document the new prefix function type constructors
original commit: 277051fcf10e1b66ccc80e7cc064ed796097119e
2014-02-13 01:20:10 -05:00
Asumu Takikawa
1a43d2fa9d Adjust printing of -> and ->*
Use prefix printing in all cases, and add indentation
rules for pretty printing

original commit: 72c9de99e0d4b59db897c034838426f6ef5892d3
2014-02-13 01:20:06 -05:00
Asumu Takikawa
f2caa4b293 Improve error messages from : annotation form
Emit errors in terms of the original user-supplied syntax,
not the helper macro syntax

original commit: 36524740c873ba8c28202e9abc10adf0cf4618c6
2014-02-13 00:23:01 -05:00