<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>It seems like syntax-parse is expanding into untyped code (which makes sense), and typed racket can’t type check it (which also makes sense).  And also, I can’t use require/typed to import the untyped stuff that syntax/parse uses because of lexical context and hygienic macros and all that (which also makes sense).</div><div><br></div><div>So is there a version of syntax/parse that expands into code that typed racket can use?</div><div><br></div><div>Or is there some kind of workaround?</div><div><br></div>Right now when I do something like this:<div><div><font face="Courier New">#lang typed/racket</font></div><div><font face="Courier New">(require syntax/parse)</font></div></div><div><div><font face="Courier New">(syntax-parse #'x</font></div><div><font face="Courier New">  [x #'x])</font></div></div><div>It gives me these errors:</div><div><div><font face="Courier New">. Type Checker: missing type for identifier;</font></div><div><font face="Courier New"> consider using `require/typed' to import it</font></div><div><font face="Courier New">  identifier: ps-empty</font></div><div><font face="Courier New">  from module: syntax/parse/private/residual in: (syntax-parse (syntax x) (x (syntax x)))</font></div><div><font face="Courier New">. Type Checker: missing type for identifier;</font></div><div><font face="Courier New"> consider using `require/typed' to import it</font></div><div><font face="Courier New">  identifier: syntax-patterns-fail</font></div><div><font face="Courier New">  from module: syntax/parse/private/residual in: (syntax-parse (syntax x) (x (syntax x)))</font></div><div><font face="Courier New">. Type Checker: missing type for identifier;</font></div><div><font face="Courier New"> consider using `require/typed' to import it</font></div><div><font face="Courier New">  identifier: current-syntax-context</font></div><div><font face="Courier New">  from module: racket/syntax in: (syntax-parse (syntax x) (x (syntax x)))</font></div><div><font face="Courier New">. Type Checker: expected Parameter, but got Nothing in: (syntax-parse (syntax x) (x (syntax x)))</font></div></div><div><br></div><div>And when I do as 3 of the error messages suggest and use require/typed, it still gives me those same errors (which makes sense because of the lexical context and hygienic macros and all that).  </div><div><div><font face="Courier New">#lang typed/racket</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">(require syntax/parse)</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">(require/typed syntax/parse/private/residual</font></div><div><font face="Courier New">               [ps-empty Any]</font></div><div><font face="Courier New">               [syntax-patterns-fail Any])</font></div><div><font face="Courier New">(require/typed racket/syntax</font></div><div><font face="Courier New">               [current-syntax-context (Parameterof (U Syntax #f))])</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">(syntax-parse #'x</font></div><div><font face="Courier New">  [x #'x])</font></div></div><div><br></div><div><br></div></body></html>