> On Oct 3, 2015, at 3:59 PM, Antonio Menezes Leitao <
antonio.men...@ist.utl.pt> wrote:
>
> Hi,
>
> It seems that define-syntax is provided by typed/racket but not by typed/racket/base. Is that on purpose?
>
> The following program compiles in DrRacket, version 6.2.900.17--2015-09-20(6dfc20d/a) [3m]:
>
> #lang typed/racket
>
> (define-syntax (foo stx)
> (syntax-case stx ()
> ((_ expr)
> (syntax/loc stx expr))))
>
> However, if I change the #lang line to
>
> #lang typed/racket/base
>
> I get an error:
>
> syntax-case: unbound identifier in the transformer environment;
> also, no #%app syntax transformer is bound in: syntax-case
For that you should
(require (for-syntax racket/base))
typed/racket provides all of racket/base for-syntax, just like racket does, but
typed/racket/base doesn't, just like racket/base does.
typed/racket/base provides define-syntax in the runtime phase,
but it doesn't provide syntax-case for-syntax.