Symbols versus Strings

Racket provides two types of data for textual information.


String and Symbol Operations

The best way to get the current list of string operations is to open DrRacket's HelpDesk (under the help menu) and search for string. You'll find signatures and purpose statements for all string operations defined at your current language level. The operations let you compare strings (for equality or alphabetical order), glue them together (also called concatenation), and search for one string inside another (among other things).

The only operation that specifically handles symbols is checking whether two symbols are the same (using symbol=?). You cannot perform any operation that requires looking at the characters in the symbol (as alphabetic ordering would require).


Which Should I Use?

If you want to ignore symbols entirely, and exclusively use strings to represent textual information, that is fine for this course.

If you'd like to use a combination of symbols and strings, here are some guidelines for choosing which to use: