<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div><div>On Dec 4, 2014, at 3:24 PM, Jack Firth <<a href="mailto:jackhfirth@gmail.com">jackhfirth@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important">I’m having an issue where splicing-syntax-parameterize removes type annotations in Typed Racket. I posted a <a href="http://stackoverflow.com/questions/27302460/splicing-syntax-parameterize-disables-typed-racket-type-annotations">question</a> about it to Stack Overflow, and any assistance would be welcomed greatly.</p>
<div title="MDH:SSdtIGhhdmluZyBhbiBpc3N1ZSB3aGVyZSBzcGxpY2luZy1zeW50YXgtcGFyYW1ldGVyaXplIHJl
bW92ZXMgdHlwZSBhbm5vdGF0aW9ucyBpbiBUeXBlZCBSYWNrZXQuIEkgcG9zdGVkIGEgW3F1ZXN0
aW9uXShodHRwOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzI3MzAyNDYwL3NwbGljaW5n
LXN5bnRheC1wYXJhbWV0ZXJpemUtZGlzYWJsZXMtdHlwZWQtcmFja2V0LXR5cGUtYW5ub3RhdGlv
bnMpIGFib3V0IGl0IHRvIFN0YWNrIE92ZXJmbG93LCBhbmQgYW55IGFzc2lzdGFuY2Ugd291bGQg
YmUgd2VsY29tZWQgZ3JlYXRseS4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div>
____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br><div><blockquote type="cite"><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: rgb(255, 255, 255);">I would hazard a guess it's because the </span><code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; line-height: 18px;">splicing-syntax-parameterize</code><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: rgb(255, 255, 255);"> is basing its behavior on the untyped </span><code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; line-height: 18px;">begin</code><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: rgb(255, 255, 255);"> form instead of the </span><code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; line-height: 18px;">begin</code><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: rgb(255, 255, 255);"> form from Typed Racket, and thus knows absolutely nothing about the </span><code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; line-height: 18px;">:</code><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: rgb(255, 255, 255);"> form. If that's the case, how can I work around this?</span></blockquote><br></div><div>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. </div><div><br></div><div>As for a workaround, would something like this work for you?</div><div><div>#lang typed/racket</div><div>(require racket/stxparam</div><div> racket/splicing)</div><div>(define-syntax-parameter x #f)</div><div>(splicing-syntax-parameterize ([x #'foo])</div><div> (define #{n : Number} "string”))</div></div><div><br></div><div>Or this?</div><div><div>#lang typed/racket</div><div>(require racket/stxparam</div><div> racket/splicing)</div><div>(define-syntax-parameter x #f)</div><div>(: n Number)</div><div>(splicing-syntax-parameterize ([x #'foo])</div><div> (define n "string”))</div></div><div><br></div><div><br></div></body></html>