How to Design Programs: An Introduction to Programming and Computing

Info icon 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 5 Symbolic 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 symbol is a sequence of keyboard characters 16 preceded 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, 'east will usually refer to the direction where the sun rises, 'professor will be the title of a person teaching and researching at a university. [planets in DrScheme] Figure 7: The planets as images in DrScheme Like 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 true if and only if the two symbols are identical: (1 of 5) [2/5/2008 4:43:34 PM]
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.