[racket] Check Syntax arrows for #lang languages

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Jul 3 13:54:14 EDT 2012

2012/7/3 Robby Findler <robby at eecs.northwestern.edu>

> This is the function you want, I think:
>
> +
> +(define (sym->original-syntax sym srcloc)
> +  (define p (open-input-string (symbol->string sym)))
> +  (port-count-lines! p)
> +  (match-define (list source-name line column position span) srcloc)
> +  (set-port-next-location! p line column position)
> +  (read-syntax source-name p))


Sneaky.

Thanks!

/Jens Axel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120703/e8a1b606/attachment.html>

Posted on the users mailing list.