Chapter 7 - Programming Language

Chapter 7 - Programming Language

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

if($flag) $count1 = 0; else $count2 = 0;

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

1 year ago

Date created

Mar 14, 2020

Cards (24)

Section 1

(24 cards)

if($flag) $count1 = 0; else $count2 = 0;

Front

What is equivalent of this: ($flag? $count1: $count2) = 0;

Back

(1) Design language without function side effects (2) Ensure that operands are evaluated in a specific order

Front

There are two possible solutions to the problem of operand evaluation order and side effects

Back

parameter

Front

The value of a referentially transparent function depends entirely on its ____________s

Back

is determined without evaluating all of operands or operators, arithmetic expression, boolean expression

Front

Short-circuit evaluation is an evaluation that ____________________________________. It can occur in both ____________s and ____________s

Back

use of an operator for more than one purpose

Front

____________________________________ is called operator overloading

Back

any two expressions that have the same value can be substituted for each other without affecting actions of programs

Front

A program has the property of referential transparency if ____________________________________

Back

side effects exist in non-evaluated portions of expressions, the entire expression is evaluated, program correctness depends on the execution of the side effect

Front

Subtle errors can occur with a short-circuit evaluation: Situations where ________________________. Side effect would then only occur when ________________________. Only an issue if ________________________

Back

casting

Front

Explicit type conversion is referred as ____________

Back

function changes one of its parameters or a global variable

Front

Functional side effects occur when ____________________________________

Back

shorthand method (such as: i += 5; or sum -= 12;)

Front

Compound assignment operators are the ____________

Back

converting from a small range type to a large range type, safe, reduced accuracy

Front

Widening conversion is ____________________________________. Although it is nearly always ____________, they can result in ____________

Back

converting from a large range type to a small range type

Front

Narrowing conversion is ____________________________________

Back

define conventions for implicit operand type conversion

Front

Mixed-mode expressions must ________________________ because computers do not have binary operations that take operands of different types

Back

mathematical function

Front

Being referentially transparent makes a function equivalent to a ____________, in terms of ease of understanding

Back

argument, extended, built-in data type

Front

The meaning of operators depends on ____________s. Operators can be ____________ to work with more than just ____________

Back

C, C++, Perl, Python, Ruby

Front

Logical operators of ______/______/______/______/______ are all short-circuit evaluated

Back

compiler error detection, readability

Front

Some overloaded operators have potential troubles because of loss of ________________________ and of some loss of ____________

Back

arithmetic expressions whose an operator can have operands of different types, how the coercion occurs

Front

Mixed-mode expressions are languages that allow ____________________________________. Language must define ____________________________________

Back

semantics of programs are much easier to understand, mathematical functions are mimic

Front

Advantage of referential transparency is that ____________________________________ and ____________________________________

Back

evaluation order does not matter

Front

If functional side effects do not exist, ____________________________________

Back

Identifiers are just names of values and those values don't change

Front

How do functional languages handle assignment statements?

Back

They decrease in the type error detection ability of the compiler

Front

Disadvantage of coercion: ____________________________________

Back

multiple-target multiple-source assignment

Front

Several recent programming languages, including Perl, Ruby, and Lua, provide ____________ statement such as: ($first, $second, $third) = (20, 40, 60);

Back

operator precedence, operator associativity, operand evaluation, side effects, user-defined operator overloading, type mixing

Front

Design issues for arithmetic expressions: What are the ____________ rules? What are the ____________ rules? What is the order of ____________? Are there restrictions on operand evaluation ____________? Does the language allow ________________________? What ____________ is allowed in expressions?

Back