[racket] Issue with splicing-syntax-parameterize in Typed Racket
Unfortunately those options wouldn't help because I ran across this issue
where an extension to Typed Racket I was working with was using
splicing-syntax-parameterize "under the hood" to provide some interesting
extensions. I would prefer it if those extensions didn't prohibit use of :
within them for type annotations.
On Thu, Dec 4, 2014 at 12:37 PM, Alexander D. Knauth <alexander at knauth.org>
wrote:
>
> 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
> <http://stackoverflow.com/questions/27302460/splicing-syntax-parameterize-disables-typed-racket-type-annotations>
> 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/9ee2dfbf/attachment.html>