[plt-scheme] [scribble] syntax quasi/unquote

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Wed Apr 28 23:52:06 EDT 2010

>> However, I'm not able to render text @SCHEME[`#] or @SCHEME[#,]. Why is that?
> 
> They're not complete S-expressions, so it's like trying @scheme["a].
> You'll have to use something like @schememetafont{#,}.

right, thanks.

>> Also, there doesn't seem to be a @SCHEMEBLOCK+eval or @DEF+int, so I don't 
>> know how to have that code evaluated (and typeset as @SCHEMEBLOCK does)
> 
> Probably we should add those variants.

yes, that would be nice.

> Meanwhile, you can use
> `eval:alts' to separate the typeset expression from the evaluated
> expression. Then, for the typeset part, escape to use SCHEME:
> 
> @interaction[
>  (eval:alts @#,SCHEME[#`(#,10)] #`(#,10))
> ]

Sorry I did not understand that. 

Concretely I want the following:

@SCHEMEBLOCK[
  (define-syntax FOO
   (lambda (stx)
     (syntax-case stx ()
      ((FOO val)
       (let ((var (datum->syntax stx 'x)))
        #`(let ((#,var (lambda ....)))
            ....))))
]

to be turned into the equivalent of a @def+int

I tried various versions with @#,SCHEME[...] but clearly I don't understand what I'm doing there.

Thanks,

-- Éric




Posted on the users mailing list.