This preview shows pages 1–3. Sign up to view the full content.
How to Design Programs: An Introduction to Computing and Programming [Go to first, previous, next page; contents; index]Section 5Symbolic Information[../icons/plt.gif]Symbols, Images These days computers mostly process symbolic information such as names, words, directions, or images. All modern programming languages support at least one way of representing symbolic information. Scheme supports several ways to express symbolic information: symbols, strings, (keyboard) characters, and images. A symbolis a sequence of keyboard characters16preceded by a single forward quotation mark: 'the'dog'ate'a'chocolate'cat!'two^3'and%so%on?Like a number, a symbol has no inherent meaning. It is up to the function's user to relate symbolic data and real-world information, though the connection is typically obvious in a specific context. For example, 'eastwill usually refer to the direction where the sun rises, 'professorwill be the title of a person teaching and researching at a university.[planets in DrScheme]Figure 7:The planets as images in DrSchemeLike numbers, symbols are atomic pieces of data. Their purpose is to represent things such as family and first names, job titles, commands, announcements, and so on. Scheme provides only one basic operation on symbols: symbol=?, a comparison operation. It consumes two symbols and produces trueif and only if the two symbols are identical: (1 of 5) [2/5/2008 4:43:34 PM]
has intentionally blurred sections.
Sign up to view the full version.