Racket provides two types of data for textual information.
'Kathi
'CS1101
and 'hot-dog
are
examples of symbols."Kathi"
, "CS 1101"
and
"hot dog"
are examples of strings.
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).
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:
'small
,
'medium
, 'large
).
You can use punctuation marks to get the effect of space in symbols
(as we did with the 'hot-dog
symbol).