Concepts of Programming Languages
240 Chapter 5 Names, Bindings, and Scopes d. main calls fun3; fun3 calls fun1. e. main calls fun1; fun1 calls fun3; fun3 calls f ...
Programming Exercises 241 Write a Common LISP program that clearly shows the difference between static and dynamic scoping. Wri ...
This page intentionally left blank ...
243 6.1 Introduction 6.2 Primitive Data Types 6.3 Character String Types 6.4 User-Defined Ordinal Types 6.5 Array Types 6.6 Asso ...
244 Chapter 6 Data Types T his chapter first introduces the concept of a data type and the characteristics of the common primiti ...
6.1 Introduction 245 is that the interface of a type, which is visible to the user, is separated from the representation and set ...
246 Chapter 6 Data Types predefined types. In object-oriented languages, every instance of every class, whether predefined or us ...
6.2 Primitive Data Types 247 A negative integer could be stored in sign-magnitude notation, in which the sign bit is set to indi ...
248 Chapter 6 Data Types 6.2.1.3 Complex Some programming languages support a complex data type—for example, Fortran and Python. ...
6.2 Primitive Data Types 249 However, it takes only 20 bits to store the same number in binary.^2 The opera- tions on decimal va ...
250 Chapter 6 Data Types To provide the means of processing codings of single characters, most programming languages include a p ...
6.3 Character String Types 251 the null character. The character string literals that are built by the compiler also have the nu ...
252 Chapter 6 Data Types its catenation operator and includes functions for substring referencing and getting the size of a stri ...
6.3 Character String Types 253 The second option is to allow strings to have varying length up to a declared and fixed maximum s ...
254 Chapter 6 Data Types The limited dynamic strings of C and C++ do not require run-time descrip- tors, because the end of a st ...
6.4 User-Defined Ordinal Types 255 operations are slowed by the required pointer chasing. On the other hand, using adjacent memo ...
256 Chapter 6 Data Types 0 to represent blue, 1 to represent red, and so forth. These values could be defined as follows: int re ...
6.4 User-Defined Ordinal Types 257 from the context of its appearance. For example, if an overloaded literal and an enumeration ...
258 Chapter 6 Data Types In the area of reliability, the enumeration types of Ada, C#, F#, and Java 5.0 provide two advantages: ...
6.5 Array Types 259 for the subtype, except assignment of values outside the specified range. For example, in Day1 : Days; Day2 ...
«
9
10
11
12
13
14
15
16
17
18
»
Free download pdf