[plt-scheme] Slideshow `code' macro improvements

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Sep 6 11:56:11 EDT 2005

I've improved the way the `code' macro works for Slideshow (or
texpict). Any of the changes could affect old slides, but the most
likely effect has to do with constants versus literals.

 * Added `current-literal-list' and `current-literal-color', in
   addition to `current-const-list' and `current-const-color'.

   The `-literal-' functions are for numbers, strings, etc., and the
   `-const-' functions are for `cons', `empty?', etc. The default list
   for `current-const-list' is empty, but "code.ss" also exports
   `mzscheme-const-list', which could be used to initialize the
   parameter.

 * The 'paren-shape property of a syntax object determines whether
   parentheses, square brackets, or curly braces are drawn for a syntax
   list/pair. The hard-wired patterns for `cond', etc. have been
   removed.

 * Added support for quasiquote, unquote, quasisyntax, etc. to draw as
   backquote, comma, hash-backquote, etc. The `current-reader-forms'
   parameter controls which ones are enabled.

 * Added an optional identifier to `define-code' to select the escape
   identifier. For example, use

     (define-code my-code typeset-code esc)

   to define a `my-code' macro that is like `code', except that `esc'
   is the escape keyword instead of `unsyntax'. This is mostly for when
   you want t otypeset code that contains `unsyntax'.

 * Color variations due to `code:comment', `quote', etc. are consistent.
   For example, `(code (code:comment (+ 1 2)))' draw the `1' and `2' in
   the comment color instead of the literal color. Also, the
   `code-colorize-enabled' parameter reliably disables coloring.
   Quasiquote/unquote nesting is handled the usual way.

 * Added a `code-quote-colorize-enabled' parameter, which can be used
   to disable color variation due to `quote'. In other words, it makes
   the display more like DrScheme's interactive coloring and less like
   Check Syntax or tex2page.

Matthew



Posted on the users mailing list.