[plt-scheme] Literate scribbling question

From: Eli Barzilay (eli at barzilay.org)
Date: Thu May 21 05:41:13 EDT 2009

On May 21, Anthony Cowley wrote:
> I was experimenting with the scribble/lp language, and found the
> need for the @chunks rather frustrating as they take up horizontal
> space and introduce a required chunk label.

IIRC, it should work with something like @chunk[foo

  (blah blah)

] just fine, does that help?


> Replacing the @chunk calls with @schemeblock made the resulting
> scribble document (generated via lp-include) look very nice, but the
> source file was no longer a valid PLT Scheme program (in the sense
> that, when run, it would yield an error due to not having any
> chunks).
> 
> At this point I realized that what I actually wanted was quite close
> to scribble/lp, but not quite the way I understand it to currently
> be.  I'd like the labels to just come from define forms (perhaps
> with the option of me labeling other chunks for inclusion in the
> table of contents),

How would you label other chunks?  How would you deal with text that
happens to have "(define ...)"?  And what about `define-values',
`define-syntax', etc -- and some random macro that expands to a
`define'?


> and I'd also prefer to not have to annotate a valid syntactic form
> at all. This latter is perhaps unworkable, hence this email: Could
> we switch the reader into Scheme mode when encountering an
> un-escaped left-parenthesis, and remain in text mode at all other
> times?

But there could be valid chunks of code that have no parens around
them, and besides, the whole point of the scribble syntax is to make
escapes minimally necessary -- either scheme mode or text mode with
an unambiguous way to switch between the two.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.