[racket] Issue with splicing-syntax-parameterize in Typed Racket
On Dec 4, 2014, at 3:24 PM, Jack Firth <jackhfirth at gmail.com> wrote:
> I’m having an issue where splicing-syntax-parameterize removes type annotations in Typed Racket. I posted a question about it to Stack Overflow, and any assistance would be welcomed greatly.
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
> I would hazard a guess it's because the splicing-syntax-parameterize is basing its behavior on the untyped begin form instead of the begin form from Typed Racket, and thus knows absolutely nothing about the : form. If that's the case, how can I work around this?
I don’t know why this is happening, but I don’t think it’s an issue with using an untyped begin versus a typed begin, because using for instance splicing-local or splicing-let gives the expected type error.
As for a workaround, would something like this work for you?
#lang typed/racket
(require racket/stxparam
racket/splicing)
(define-syntax-parameter x #f)
(splicing-syntax-parameterize ([x #'foo])
(define #{n : Number} "string”))
Or this?
#lang typed/racket
(require racket/stxparam
racket/splicing)
(define-syntax-parameter x #f)
(: n Number)
(splicing-syntax-parameterize ([x #'foo])
(define n "string”))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141204/7be19cc3/attachment-0001.html>