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
> (symbol=? 'and and) Invalid use of keyword and > (symbol=? 'not not) symbol=?: expected symbols as arguments, received 'not and not
(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.
Exercise Notes
Exercise 5.1.2 To use the guess.ss teachpack in DrScheme, choose the Language|Add Teachpack menu item. The file dialog starts in the teachpack directory of the plt installation directory. From there, go into the htdp directory and select the file guess.ss.
After clicking Execute, the definitions window shows guess.ss in its header, indicating that the teachpack is loaded. You must click the Execute button after selecting the teachpack before using it (otherwise DrScheme warns you that ``the program has changed,'' meaning that a different teachpack is now used by the program).
A teachpack extends the set of built-in operations and programs provided by DrScheme. After the guess.ss teachpack is selected, DrScheme provides the repl program.
More than one teachpack can be loaded at a time. The current set of teachpacks is stored as a preference, so even if you quit and restart DrScheme, the selected set is preserved. If you open multiple windows in DrScheme, the teachpack selection applies to all windows.
DrScheme's Language menu provides a menu item for each selected teachpack that clears it from the selected set, plus a Clear All Teachpacks menu item for clearing the entire set.
DrScheme Jr supports only non-graphical teachpacks. To select a teachpack for DrScheme Jr, use the --teachpack command-line flag, followed by a path to the teachpack file.
Exercise 5.1.5 For information on selecting the master.ss teachpack, see the above note for exersice 5.1.2.