Chapter 6 - Programming Language

Chapter 6 - Programming Language

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

The major design issue of union data type is ____________

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

2 years ago

Date created

Mar 1, 2020

Cards (53)

Section 1

(50 cards)

The major design issue of union data type is ____________

Front

type checking

Back

The most basic type is called ____________s

Front

primitive data type

Back

A programming language is strongly typed if ____________________________________

Front

type errors are always detected

Back

Type checking is ____________________________________

Front

the process of verifying and enforcing operands for an operator to be a compatible type

Back

An ____________ allow leaving out record names as long as the reference is ____________

Front

elliptical reference, unambiguous

Back

A ____________ to a record field is one in which all intermediate record names, from the largest enclosing record to the specific field, are named in the reference

Front

fully qualified reference

Back

C and C++ are not strongly typed because ________________________ and ________________________

Front

parameter type checking can be avoided, unions are not type checked

Back

Coercion is ____________________________________

Front

implicitly automatic conversion

Back

Type error is ____________________________________

Front

the application of an operator to an operand of an inappropriate type

Back

Advantage of strong type is to ____________________________________

Front

allow the detection of the misuses of variables that result in type errors

Back

Coercion rules strongly affect ____________--they can weaken it considerably

Front

strong typing

Back

Elliptical references allow ________________________

Front

leaving out record names as long as references are unambiguous

Back

Boolean types could be implemented as ____________s, but often as ____________s. Its advantage is ____________

Front

bit, byte, readability

Back

A data type defines ________________________ and ________________________

Front

a collection of data objects, a set of predefined operations on those objects

Back

A tuple is a data type that is similar to a record, except ________________________

Front

the elements are not named

Back

Fully qualified references must ________________________

Front

include all record names

Back

E=>e:T The statement means ____________________________________

Front

expression e has the type T in environment E

Back

Static length need a ____________. Limited dynamic length may need a ____________ for length (but not in C and C++). Dynamic length need ____________; allocation/deallocation is the biggest implementation problem

Front

compile-time, runtime descriptor, runtime descriptor

Back

If all type bindings are ____________, nearly all type checking can be ____________. Type checking occurs at ____________. If type bindings are ____________, type checking must be ____________. Type checking occurs at ____________

Front

static, static, compile time, dynamic, dynamic, run time

Back

Record is used when ________________________ and different fields are ________________________

Front

collection of data is heterogeneous, not processed in the same way

Back

Type checking may occur at ____________ for static type checking if ____________ is static. Type checking may occur at ____________ for dynamic type checking if ____________ is dynamic

Front

compiler time, type binding, run time, type binding

Back

A substring reference is ________________________

Front

a reference to a substring of a given string

Back

Some of the primitive types are merely reflections of the ____________-- for example, most integer types. Others require only a little ____________ support for thier implementation

Front

hardware, nonhardware

Back

Typing specifies ____________________________________

Front

meaning of 'something' (object/variable) in memory

Back

Floating-point data types model real numbers, but the represenatations are only ____________s for many real values. Languages for scientific use support at least two floating-point types (e.g., ____________ and ____________). Sometimes more

Front

approximation, float, double

Back

Decimal types have the advantage of being able to ____________, at least those within a restricted range, which cannot be done with floating-point. However, it has limited range and often wastes memory

Front

precisely store decimal values

Back

Strings to have varying length with no maximum, as in JavaScript, Perl, and the standard C++ library are called ____________

Front

dynamic length strings

Back

The most common string operations are ____________, ____________, ____________, ____________, and ____________

Front

assignment, catenation, substring reference, comparison, pattern matching

Back

A record is ________________________

Front

an aggregation of elements where each element is identified by a name

Back

Strings have varying length up to a declared and fixed maximum set by the variable's definition, as exemplified by the strings in C and the C-style strings of C++ are called ____________. In these languages, a special character is used to indicate ________________________, rather than maintaining the length

Front

limited dynamic length strings, the end of a string's characters

Back

The elements of a heterogeneous array are all references to ____________s that reside in scattered locations, often on the ____________

Front

data object, heap

Back

An object represents ________________________

Front

an instance of a user-defined type

Back

The records and heterogeneous array look the same, but that is not the case. The elements of a heterogeneous array are all references to data objects that reside in scattered locations on the heap. The elements of a record may be ________________________

Front

of different sizes but reside in adjacent memory location

Back

The ____________, relative to the beginning of the record, is ________________________

Front

offset address, associated with each field

Back

Enumerated type aids to ____________ and ____________. It has two advantages: (1) no ____________s are legal on enumeration types; (2) no enumeration variable can be assigned a value ________________________

Front

readability, reliability, arithmetic operation, outside its defined range

Back

There may be as many as ______ integer types in a language. Java's signed integer sizes: ____________, ____________, ____________, ____________

Front

8, byte, short, int, long

Back

____________ could be used with record field access, but it would disallow ____________ and it would be ____________

Front

dynamic subscripts, type checking, slower

Back

An ordinal type is one in which ____________ can be easily associated with ____________

Front

the range of possible values, the set of positive integers

Back

False (parameter type checking can be avoided; unions are not type checked), True (almost because of explicit type casting), True

Front

TRUE or FALSE (1) C and C++ are strong type (2) Java and C# are strong type (3) ML and F# are strong type

Back

A compatible type is one that is either ________________________ or is ________________________ to be ________________________. This automatic conversion is called a ____________

Front

legal for the operator, allowed under language rules, implicitly converted by compiler to a legal type, coercion

Back

____________ was used mostly, but ____________ alternated in 1991

Front

ASCII, Unicode

Back

A union is a type ____________________________________

Front

whose variables store different data type values at different times during program execution

Back

Arrays are used when all the data values have the same type and/or are processed in the same way. Such processing is well supported by using ____________ as the addressing method. Because a record uses ____________ subscripts, ________________________

Front

dynamic subscripting, static, it provides an efficient access to the fields

Back

Decimal types are stored like character strings, using binary codes fro the decimal digits. These representations are called ____________

Front

binary coded decimal (BCD)

Back

Examples of strongly typed languages

Front

Java, C#, ML, F#, Haskell, Perl

Back

An enumeration type is ____________________________________

Front

one in which all of the possible values, which are named constants, are provided, or enumerated, in the definition

Back

Type checking can prevent (1) ________________________ (2) ________________________ (3) ________________________ (4) ________________________

Front

use of undeclared variables, functions with wrong number parameters, functions that do not return values, division by 0

Back

Design issues of a record: (1) ________________________ (2) ________________________

Front

what is the syntactic form of references to the field? Are elliptical references allowed?

Back

Compatible type is one that ____________________________________

Front

is either legal for the operator or is allowed under language rules to be implicitly converted

Back

Character string type in C and C++ is not ____________ and uses ____________s and a ____________ of functions that provide operations

Front

primitive, char arrays

Back

Section 2

(3 cards)

Members of union are ________________________

Front

mapped to the same address within its object

Back

Type checking of unions requires that each union constructor requires a ____________. Such that is called ____________ or ____________ and a union with them is called ____________

Front

type indicator, tag, discriminant, discriminated union

Back

The overall size for a union would be ________________________

Front

the size of the largest member

Back