Skip to content

get-racket-referenced-identifiers only works on host, fix docs and errors #80

@michaelballantyne

Description

@michaelballantyne
#lang racket

(require syntax-spec-dev)

(syntax-spec
  (nonterminal dsl-expr
    (dsl+ e:dsl-expr e2:dsl-expr)
    v:racket-expr)
  
  (host-interface/expression
    (dsl e:dsl-expr)
    (displayln (get-racket-referenced-identifiers [racket-var] #'e))
    #'#'e))

(let ([x 6])
  (dsl (dsl+ x 5)))

raises

dsl+: dsl-expr may not be used as an expression in: (dsl+ (#%host-expression x) (#%host-expression 5))

which is not a nice error.

Happens because the operation local-expands the syntax. Should add a check that it's a host-expression form first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions