[racket] abstracting over codeblock

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Sep 8 21:44:28 EDT 2011

I think we need to add a function version of `codeblock'. The current
`codeblock' is a syntactic form so that it can grab the lexical context
for hyperlinks; the function version of `codeblock' would take a syntax
object to supply the context.

But for `mycode', could you just define it as a macro taht expands to
`codeblock'?

At Thu, 8 Sep 2011 20:15:58 -0400, Shriram Krishnamurthi wrote:
> I'm trying to convert some old slatex'ed documents into scribble and
> running into trouble.  I don't seem to have a clear enough handle on
> how to use codeblock.
> 
> I can, for instance, convert
> 
>   \begin{schemedisplay}
>   foo
>   bar
>   \end{schemedisplay}
> 
> into
> 
>   @mycode{
>   foo
>   bar
>   }
> 
> where
> 
>   @(define(mycode . terms) (apply verbatim terms))
> 
> works fine.  However, codeblock is syntax, not a function, so I can't
> just replace "verbatim" with "codeblock" above.  I can't replace
> "apply verbatim" with "codeblock", either:
> 
>   string-append: expects argument of type <string>; given '("foo" "\n" "bar")
> 
> It'd be very helpful to see the mycode function such that it uses
> codeblock and sets the optional line-numbering flag (#:line-numbers
> <number>) to 1, say.
> 
> Thanks,
> Shriram



Posted on the users mailing list.