<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div style>Terrific, thanks for the bug fix. This is just what I was hoping for. Works perfectly.</div><div style><br></div><div style><br></div><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
<br>
</div>The `scribble/reader' library provides `make-at-reader', which lets you<br>
pick the escape character. You can use that with `#reader', which lets<br>
you pick a reader.<br>
<br>
Unfortunately, there's a bug that makes `make-at-reader; work only for<br>
ASCII characters; I've just pushed a fix for that to the git repo. For<br>
the example below, I've used a tilde to avoid the bug, but you could<br>
use any Unicode character with a new build from source or with the next<br>
nightly build.<br>
<br>
----------------------------------------<br>
;; tilde.rkt:<br>
----------------------------------------<br>
#lang racket/base<br>
(require (only-in scribble/reader make-at-reader))<br>
<br>
(provide (rename-out [tilde-read read]<br>
[tilde-read-syntax read-syntax]))<br>
<br>
(define read-inner<br>
(make-at-reader #:command-char #\~<br>
#:syntax? #t<br>
#:inside? #t))<br>
<br>
(define (tilde-read p)<br>
(syntax->datum<br>
(tilde-read-syntax (object-name p) p)))<br>
<br>
(define (tilde-read-syntax name p)<br>
(define i (read-inner name p))<br>
(datum->syntax i (cons 'begin i) i))<br>
<br>
----------------------------------------<br>
;; example.scrbl<br>
----------------------------------------<br>
#lang scribble/base<br>
@#reader "tilde.rkt"<br>
<br>
This is an example with @ signs and a definition.<br>
<br>
~(define x "at")<br>
<br>
Example: @ is ``~x''.<br>
<br>
</blockquote></div><br></div></div>