[racket] Projectional Editors

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Jul 8 05:06:06 EDT 2013

The markers are called syntax-properties and you can use the
syntax-property function to attach one to the output of the macro.

This is a link to the docs
for drracket:module-language-tools:add-online-expansion-handler:

http://docs.racket-lang.org/tools/drracket_module-language-tools.html#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3amodule-language-tools~3aadd-online-expansion-handler%29%29

That is how the information for the arrows are collected. The precise
grammar of the syntax object is given  here:

http://docs.racket-lang.org/reference/syntax-model.html?q=expand#%28part._fully-expanded%29

but I think you can probably get away with a simpler loop that just walks
over the syntax object like this:

(define (walk-over stx)
  (let loop ([stx stx])
    (cond
      [(syntax? stx)
       (check-for-property-and-do-something stx)
       (loop (syntax-e stx))]
      [(pair? stx)
       (loop (car stx))
       (loop (cdr stx))]
      [else (void)])))

The check-for-property-and-do-something would collect whatever information
was left in the properties and return it using the
drracket:module-language-tools:add-online-expansion-handler handler.

hth,
Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130708/a3602615/attachment.html>

Posted on the users mailing list.