Section 5

Symbolic Information

Spaces are allowed between a ' and the sequence of characters that make up a symbol, but this is discouraged as a matter of style. Spaces cannot appear between other characters in the symbol. The set of legal characters to build symbols is the same as for program variable names, so parentheses, quotes, #, ;, and | must be avoided. Also, like variable names, symbols are case-sensitive:

> (symbol=? 'hello 'Hello)
false

Don't forget the starting quote. Without it, DrScheme does not see a symbol, but instead attempts to find the meaning of a name. This can lead to an error:

> (symbol=? 'hello hello)
reference to undefined identifier: hello

or more confusing behavior if DrScheme happens to recognize the name:
> (symbol=? 'and and)
Invalid use of keyword and
> (symbol=? 'not not)
symbol=?: expected symbols as arguments, received 'not and not

Don't add a quote when you really mean a variable:
(define (is-hello? s)
  (symbol=? 'hello 's)) ; wrong: 's is never 'hello
(define (is-hello? s)
  (symbol=? 'hello s)) ; right: s is sometimes 'hello

Images

To insert an image into a program, move the blinking caret to the place in your program where you want the image, and select the Insert Image item from the Edit menu. DrScheme will then provide a dialog for selecting an image file. After you have selected a file, the image will be inserted at the blinking caret.

Beware! If you use images in your program, DrScheme saves your program file in a special format, instead of the normal text format. Only DrScheme can read this special format.
If there is a problem loading an image from a file, DrScheme displays a box with an ``x'' instead of a picture. The problem is usually due to a corrupted image file.

Images can also be copied from web pages viewed through DrScheme's Help Desk. The File|Open URL... menu item opens a web page in Help Desk.

Under Windows, images copied from other programs (besides DrScheme) can also be pasted into DrScheme.

5.1  Finger Exercises with Symbols

Exercise Notes

Exercise 5.1.2 For information about selecting a teachpack, see the Exercise Notes for Exercise 2.2.1.

Exercise 5.1.5 For information about selecting a teachpack, see the Exercise Notes for Exercise 2.2.1.