Commit Graph

15 Commits

Author SHA1 Message Date
Stephen Chang
31c3bba5c9 add current-host-lang; fix reuse to work with non-strs
- other various stx conveniences
- provide more require/provide forms in default mod-beg
- fix tests and examples to work with current-host-lang
2017-03-22 17:04:48 -04:00
Stephen Chang
115aae8e73 completely separate type and kind api, etc; generalize type environment
Previously, "type" functions were reused a lot to manipulate kinds, and other
metadata defined via `define-syntax-category`, but this meant it was impossible
to define separate behavior for some type and kind operations, e.g., type=? and
kind=?. This commit defines a separate api for each `define-syntax-category`
declaration.

Also, every `define-syntax-category` defines a new `define-NAMEd-syntax` form,
which implicitly uses the proper parameters, e.g., `define-kinded-syntax` uses
`kindcheck?`, `current-kind-eval`, and the ':: kind key by default (whereas
before, it was using typecheck?, type-eval, etc).

This commit breaks backwards compatibility. The most likely breakage results
from using a different default key for kinds. It used to be ':, the same as
types, but now the default is '::.

This commit also generalizes the contexts used with `define-NAMEd-syntax` and
`infer`.
- all contexts now accept arbitrary key-values associated with a variable
- all contexts use let* semantics, where a binding is in scope for subsequent
  bindings; this means that one environment is sufficient in most scenarioes,
  e.g., type and term vars can be mixed (if properly ordered)
- environments allow lone identifiers, which are treated as type variables by
  default
2017-02-08 13:07:24 -05:00
Stephen Chang
7677a7accb mlish: use define-typerule in define-type output, to match paper 2016-10-12 14:24:43 -04:00
Stephen Chang
691ba9c51c Turnstile forms no longer automatically provide; add type-out
- not auto-providing more closely adheres to idiomatic Racket
- this commit changes:
  - define-typed-syntax
    - removed #:export-as option
  - define-base-type
    - removed #:no-provide option
  - define-type-constructor
    - removed #:no-provide option
- type-out helps with providing defined types
- in examples, move define and define-type-alias to ext-stlc
- fix bug in reuse where renamed id not provided
2016-10-12 10:46:05 -04:00
Stephen Chang
fc5731de00 dont auto provide define-primops; add typed-out 2016-10-09 18:12:12 -04:00
Stephen Chang
cb36097f8d mlish define-type to more closely resemble paper 2016-10-05 10:33:18 -04:00
Stephen Chang
5296774b9a modify mlish app, lam and define to more closely resemble paper 2016-10-05 09:44:03 -04:00
Stephen Chang
df4c26dd8d type=? handles binding types by default
- closes #32
2016-09-29 14:27:17 -04:00
AlexKnauth
3d92dbdde3 add #lang turnstile/lang; change #lang turnstile's #%module-begin 2016-08-31 18:49:25 -04:00
AlexKnauth
e9230e0ba3 remove square brackets around syntax-parse kws 2016-08-17 17:49:37 -04:00
AlexKnauth
2ddf45f8de remove brackets around e ≫ e- 2016-07-26 11:44:17 -04:00
AlexKnauth
a8f1634baa start copying tests over to macrotypes/examples/tests 2016-06-30 17:42:23 -04:00
AlexKnauth
ceed899f5f add define, *, and a new join 2016-06-28 14:01:54 -04:00
AlexKnauth
da3ecfa780 refactor type-constraints a bit 2016-06-28 13:51:50 -04:00
AlexKnauth
103086a62c rename typed-lang-builder -> turnstile 2016-06-28 13:35:51 -04:00