1 Creating Annotated Code
1.1 Inserting Annotated Code Boxes
1.2 Annotating Existing Code
2 Manipulating Annotated Code
Version: 4.2

Annotated Code Boxes

Jordan Johnson <jmj at fellowhuman dot com>

This package implements annotated code chunks in DrScheme. It allows you to write an expression, annotate it, and hide the code so that your expression is visually represented by a box containing only the annotation.

1 Creating Annotated Code

Installing this package adds two items to the DrScheme menu system, allowing you to insert annotated-code boxes and annotate selected code.

1.1 Inserting Annotated Code Boxes

On the Insert menu, this package adds an item Insert Annotated Code Box, which inserts a box at the current cursor position.

1.2 Annotating Existing Code

On the Scheme menu, this package adds an item Annotate this Code, which behaves as follows:

2 Manipulating Annotated Code

Once created, an annotated-code box behaves somewhat similarly to a comment box. It will be evaluated as an expression in the context of the surrounding code, and the Tab and Shift-Tab keystrokes allow movement between the two fields.

At the left side of each annotated-code box the word "expr" appears. If the last edit inside the box left one or more complete expressions in the box’s code editor, "expr" will be blue; if not, it will be red. Right-clicking this "expr" produces a menu that allows hiding and showing the code editor, and converting the annotated-code box to plain Scheme source text (with or without including the annotation as a Scheme comment).