[plt-scheme] scribbling newbie

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jan 14 09:26:15 EST 2008

On Jan 14, Matthew Flatt wrote:
> A clarification:
> 
> At Tue, 8 Jan 2008 12:47:19 -0700, Matthew Flatt wrote:
> > As you say, they mean the same thing. After experimenting with
> > different ways of writing module imports in Scribble source, we
> > like `@(require X)' better than `@require[X]'.
> 
> This note was specific to `require's at the top of Scribble source
> files. I still prefer `@scheme[...]', `@schemeblock[...]',
> etc. inside the body of a Scribble file, probably because it helps
> separate the typesetting layer from the expression to be typeset.

[

To clarify even more, in case anyone is interested: a `@foo[x]{y}'
form is read as a sexpr where `foo' is the first item, the (optional)
bracketed `x' is parsed as a datum, and the braced (optional) `y' as a
string.  This means that @require[whatever], @+[1 2], and @begin[blah
blah] are all read the same string-less expressions.  If both the
brackets and braces are omitted, then the resulting expression is not
put in parens, which is a convenient escape-to-scheme (either a single
identifier or an expression).

So, when you mean to write some Scheme code, just prefix it with a
`@'.  @scheme[...] etc are still the same as @(scheme ...) etc, but
they're intended for formatting the contents so the bracketed form is
a better expression for this purpose.

]

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


Posted on the users mailing list.