[racket] scribble syntax suggestion wrt text-mode and racket-mode arguments

From: Matthew Butterick (mb.list.acct at gmail.com)
Date: Sun Jun 9 20:05:22 EDT 2013

Semantically, "an operation [in Scribble] doesn’t care whether it’s used
with [...] or {...}." Therefore, it would be useful if Scribble expressions
were not syntactically limited to the form @ ‹cmd› [ ‹datum›* ] {
‹text-body› }, and instead allowed text-mode and racket-mode arguments to
be freely & indefinitely sequenced.

What I've found using Scribble is that many of the functions one writes
are, of course, intended to operate on a text argument. So the text-mode
argument naturally wants to come first in the function:

@cross-ref{This text}

Now, suppose I want to add an optional second argument. The natural place
for this optional argument would be after the first:

@cross-ref{This text}["where.html"]

or

@cross-ref{This text){where.html}

But AFAIK, Scribble forbids these patterns. So I might try this:

@cross-ref["where.html"]{This text}

But that doesn't work either, because the cross-ref function expects the
target text to be in the first position. So either I must forego idiomatic
Scribble expressions altogether:

@(cross-ref "This text" "where.html")

Or use a keyword argument:

@cross-ref[#:destination "where.html"]{This text}

As a workaround, that's OK. But at this point, Scribble is reaching up into
my code and starting to impose design restrictions (namely, keyword
arguments) that have ripple effects elsewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130609/9f4bb686/attachment.html>

Posted on the users mailing list.