[plt-scheme] _id in Scribble

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Mar 9 11:47:05 EDT 2009

At Mon, 09 Mar 2009 11:12:19 -0400, Dave Herman wrote:
> If I want to document a symbol with a leading underscore, Scribble drops 
> the underscore. IIUC, this is what the @schemeblock docs are talking 
> about: `_id' is treated as `id' but with `schemevarfont'. But the docs 
> are a little confusing about exactly when this behavior should apply.
> 
> Specifically, when I write
> 
>      @scheme['_Bool]
> 
> I get the ordinary datum font (not schemevarfont) but with the 
> underscore dropped.

That's because the quoted-value coloring effectively overrides the
variable font, even though the underscore is removed. I'll adjust the
docs to clarify, at a minimum, but that seems like a bad combination.

> What's the recommended way to disable the processing 
> of the underscore?

One possibility is

  @scheme['#, @schemevalfont{_Bool}]

Another is

 @(require (for-syntax scheme/base) scribble/scheme)

 @(let-syntax ([_Bool (make-element-id-transformer
                      (lambda (id) #'@schemevalfont{_Bool}))])
   @scheme['_Bool])

In both cases, I had to use `schemevalfont' to get quoted green,
though, instead of `schemeidfont' or `schemevarfont'.




Posted on the users mailing list.