[racket] Learning Scribble

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Nov 22 08:46:57 EST 2013

Yesterday, Greg Hendershott wrote:
> "Use {} with item but [] with itemize".
> 
> @itemize[
>   @item{x}
>   @item{y}
>   @item{z}
> ]

The point here is that {...} is intended for text, so if you use
@itemize{} you end up with the text between the items too (the
newlines in the above).  IIRC, originally this was done with code that
would ignore whitespaces, but then use @itemize[...] turned out to be
doing it much better -- and it makes sense in eliminating the question
of where does the "text" go when you do something like this in html:

    <ul>
      text
      <li>x</li>
      <li>x</li>
      <li>z</li>
    </ul>


> Or, "Thou shalt not put a space between the ]{ in a defproc form, else
> thou shall get an error pointing to a location other than that".

That's something that I think unfortunately trips newbies.  To repeat
the motivation: if any whitespace is allowed beween them, then you can
end up with nasty surprises, for example, in

    @(define desc "something")
    ...
    this example demonstrates @desc
    {
      printf("foo\n");
    }

the braces would be taken as arguments to `desc'.  I also considered
for a while allowing only a single space, but not only did that look
dirty (it's using an expression (= datum mode) separator for a textual
contents), it's also arbitrary (why not multiple spaces? what about
tabs?).


> Later I finally grokked why. I can translate the at-exp to the s-exp
> on the fly.

It's probably good to make this an important goal when learning the
system, even though it's a small corner of the whole thing now...

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

Posted on the users mailing list.