How to do define-for-syntax in typed racket?
问题 This works #lang racket (begin-for-syntax (define (foo n) (+ n 3))) So I would also expect this to work #lang typed/racket (: foo : Real -> Real) (define-for-syntax (foo n) (+ n 3)) But if fails with ; :: undefined; ; cannot reference an identifier before its definition After that I tried each of the following in turn in typed/racket (define-for-syntax (foo (n : Real)) : Real (+ n 3)) (begin-for-syntax (: foo (-> Real Real)) (define (foo n) (+ n 3))) (begin-for-syntax (define (foo (n : Real))