Spaces are allowed between a ' and the sequence of characters
that make up a symbol, but this is discouraged as a matter of
style. 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:
> (eq? 'hello 'Hello) #f
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:
> (eq? 'hello hello) reference to undefined identifier: hello
> (eq? 'and and) Invalid use of keyword and > (eq? 'not not) eq?: expected symbols as arguments, received 'not and not
(define (is-hello? s) (eq? 'hello 's)) ; wrong: 's is never 'hello (define (is-hello? s) (eq? '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.
Exercise Notes
Exercise 4.1.2 To use the guess-lib.ss library, choose the Language|Select Library menu item. The file dialog starts in the lib directory of the plt installation directory. From there, go into the teach directory and select the file guess-lib.ss.
The main DrScheme window will then show guess-lib.ss in the status area above the definitions window, indicating that it is the current library. You must click the Execute button after selecting the library before using it (otherwise DrScheme warns you that ``the program has changed,'' meaning that a different library is now used by the program).
A library extends the set of built-in operations and programs provided by DrScheme. After the guess-lib.ss library is selected, DrScheme provides the repl program.
The current library is stored as a preference, so even if you quit and restart DrScheme, the library selection is preserved. Only one library can be selected at a time. If you open multiple windows in DrScheme, the library selection applies to all windows.
DrScheme Jr does not support the teaching libraries.
Exercise 4.1.5 For information on selecting the master-lib.ss teaching library, see the above note for exersice 4.1.2.