pl cram Flashcards
(23 cards)
Design Issues
Character String Types
2
- Should strings be simply a special kind of character array or a primitive type?
- Should strings have a static or dynamic length?
Design Issues
Arrays
6
- What types are legal for subscripts?
- When are subscript ranges bound?
- When does array allocation take place?
- Are ragged or rectangular multidimensional arrays allowed, or both?
- Can arrays be initialized when they have their storage allocated?
- What kinds of slices are allowed, if any?
Design Issues
Unions
2
- Should type checking be required?
- Should unions be embedded in records?
Design Issues
Pointer Types
5
- What are the scope and lifetime of a pointer variable?
- What is the lifetime of a heap-dynamic variable?
- Are pointers restricted as to the type of value to which they can point?
- Are pointers used by dynamic storage management, indirect addressing, or both?
- Should the language support pointer types, reference types, or both?
Design Issues
Selection Structures
3
- What is the form and type of the expression that controls the selection ?
- How are the then and else clauses specified ?
- How should the meaning of nested selectors be specified ?
Design Issues
Multiple-selection statements
5
- What is the form and type of the expression that controls the selection?
- How are the selectable segments specified?
- Is execution flow through the structure restricted to include just a single selectable segment?
- How are case values specified?
- How should unrepresented selector expression values be handled, if at all?
Design Issues
Iterative control statements
2
- How is iteration controlled?
- Where should the control mechanism appear in the loop statement?
Design Issues
Counter-controlled loop statements
3
- What are the type and scope of the loop variable?
- Should it be legal for the loop variable or loop parameters to be changed in the loop, and if so, does the change affect loop control?
- Should the loop parameters be evaluated only once, or once for every iteration?
Design Issues
Controlled Loop Statements
2
- Should the control be pretest or posttest?
- Should the logically controlled loop be a special form of counting loop or a separate statement?
Design Issues
Loop Control Mechanisms
2
- Should the conditional mechanism be an integral part of the exit?
- Should only one loop body be exited, or can enclosing loops also be exited?
Design Issues
Subprograms
8
- Are local variables statically or dynamically allocated?
- Can subprogram definitions appear in other subprogram definitions?
- What parameter-passing methods are used?
- Are the types of the actual parameters checked against the types of the formal parameters?
- If subprograms can be passed as parameters and subprograms can be nested, what is the referencing environment of a passed subprogram?
- Can subprograms be overloaded?
- Can subprograms be generic?
- If the language allows nested subprograms, are closures supported?
Design Issues
Functions
3
- Are side effects allowed?
- What types of values can be returned?
- How many values can be returned?
What Languages…
Support negative subscripts?
3
Perl, Ruby, & Lua
What Languages…
Support array slices with stepsizes?
3
Python, Perl, & Ruby
What Languages…
Have no type coercions?
2
C & C++
What Languages…
Include multiple assignments?
3
Perl, Ruby, & Lua
What Languages…
Do not include a goto?
3
Python, Java, & Ruby
What Languages…
Predefines iterators that can be explicitly called to iterate over its predefined data structures
1
PHP
What Languages…
Borrows part of its design from Dijkstra’s guarded commands
1
Ada
What Languages
Allow a variable number of parameters?
9
- C
- C++
- Java
- Python
- Ruby
- JavaScript
- Lua
- Perl
- C#
What Languages…
Allow subprogram definitions to be nested
3
ALGOL 68, Pascal, & Ada
What Languages…
Allow multiple values to be returned from a Function
2
Ruby & Lua
What Languages…
Allow the user to overload operators
4
Ada, C++, Python, & Ruby