Expose syntax-parse/typed-syntax

Issue #50 closed
Alexis King created an issue

It would be nice to have access to a non-definition version of define-typed-syntax to be able to customize the input. My main reason for this is #%app: I would like the function name to appear at the beginning of error messages, not #%app. For that reason, I’d like to be able to write #%app like this:

(define-syntax-parser #%app
  [(_ rest ...+)
   (syntax-parse/typed-syntax #'(rest ...)
     #| ... |#)])

This is currently sort of possibly by cheating and using syntax-local-value to grab the transformer procedure and calling it directly, but that’s obviously a hack. Having access to syntax-parse/typed-syntax would be nicer.

Comments (12)

  1. Stephen Chang repo owner

    Believe it or not, we haven't provided it because we couldn't agree on a good name and didnt want to commit to anything :/ Any suggestions?

  2. Alexis King reporter

    I don’t have a strong opinion, but syntax-parse/typed or parse-typed-syntax both seem reasonable to me? Having “syntax” in there twice seems a little redundant, but I wouldn’t lose sleep over it. ;)

  3. Stephen Chang repo owner

    I'm worried syntax-parse/typed would get confused with typed racket. I like parse-typed-syntax though. @AlexKnauth ?

  4. Stephen Chang repo owner

    Now that I'm thinking about names, "typed" doesnt feel right either. It should be "typechecking". Is parse-typechecking-syntax too long?

  5. Alex Knauth

    I like what you said an hour ago about "typechecking." Following that idea, I think syntax-parse/typecheck would be a better name.

  6. Alex Knauth

    @stchang Should we rename it to syntax-parse/typecheck, keep parse-typed-syntax, or come up with something else related to the action of typechecking?

  7. Stephen Chang repo owner

    I'm thinking about it. syntax-parse/typecheck is not bad and not too long. I think we should provide a define-syntax/typecheck alias as well then?

  8. Stephen Chang repo owner

    So @lexi-lambda, we provided syntax-parse/typed-syntax as syntax-parse/typecheck. Let us know if you don't like it.

  9. Log in to comment