[plt-scheme] Sanitizing DrScheme .scm files with XML boxes for MzScheme?

From: Anton van Straaten (anton at appsolutions.com)
Date: Thu Mar 25 18:21:27 EST 2004

Roderick McGuire wrote:
> Is there someway to sanitize a .scm file written in DrScheme that
> contains XML boxes so that MzScheme can load it?

I'd like to second this as being a useful capability.

This may not be an original thought, but I haven't seen it discussed much: I
think "boxes" should really be a view of ordinary textual Scheme code.  You
should be able to switch between a source view and a "box view" on the View
menu.  (I can provide a detailed motivation for this, but hopefully it's not
necessary.)

Ideally, for XML at least, a quasiquoted expression should convert to the
equivalent set of nested boxes and back.  Of course, some indicator of where
boxes should appear is presumably needed, but I don't see much wrong with
something like:

  (define foo (xml-box `(p "woohoo!" ,awesome)))

An operation like 'xml-box' might do nothing in some cases - like the
above - but for other kinds of embedded content, would translate their
contents into the corresponding Scheme data.

Also, the above has a strong connection to the question of here-strings,
which was discussed a few weeks ago.  Matthew said "I'll add [here-strings]
for v300".  How about tying this into a textual representation for boxes -
or at least planning for that possibility in future?

Here-strings are typically used to embed another language, which is often
just text for display, but may also be e.g. SQL code or some other non-sexp
syntax.

DrScheme now supports boxes for the insertion of various kinds of non-sexp
content.  A box is essentially a kind of graphical here-string with some
knowledge of the type of "language" that it contains.  It would be useful to
extend this concept to support a textual representation, and if this was
done, the conventional notion of a here-string would be a mere subset of
boxes.

This kind of thing has some relevance to the commercial world, btw.  The
various web template systems don't tend to have good solutions when it comes
to IDEs - it's mostly done by text editing, or else by something less
integrated than DrScheme's boxes.  The ability to graphical edit
XML/quasiquoted templates, inline, in real code, is pretty impressive.  But
its use is severely limited if it has no textual representation.

Anton



Posted on the users mailing list.