Deck 3: Functional Programming

ملء الشاشة (f)
exit full mode
سؤال
In Scheme,a let special form can be used to define a recursive function.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Scheme expressions must be written in prefix form.
سؤال
The semantics of Scheme uses static type checking.
سؤال
Scheme expressions that begin with keywords are called control forms.
سؤال
The ML programming language is strongly typed.
سؤال
The simplest unit of syntax in Scheme is called an atom.
سؤال
A function that takes other functions as parameters or returns a function as a value is called a recursive function.
سؤال
A function definition describes how a value is to be computed using formal parameters.
سؤال
A pure functional program is one that consists only of functions and procedures.
سؤال
In the ML programming language,a function is declared using the lambda keyword.
سؤال
hd is the predefined list function that returns the head of a list in Scheme.
سؤال
With static scoping,the meaning of a variable depends on the runtime context.
سؤال
The rand function is referentially transparent.
سؤال
The if form in Scheme is like an if-else construct.
سؤال
A function application is a call to a defined function using actual parameters.
سؤال
The ML programming language has a built-in list reverse function called rev.
سؤال
A language is considered to be fully curried if function definitions are treated as curried and if all multiparameter built-in functions are curried.
سؤال
A Scheme compiler will translate a tail recursive function into code that executes as a loop.
سؤال
In Scheme,the letrec form makes a global binding of a variable visible in the top-level environment.
سؤال
In ML,arithmetic operators are written as infix operators.
سؤال
Which of the following represents a list in ML?

A) (1 2 3)
B) {1 2 3}
C) [1, 2, 3]
D) (1, 2, 3)
سؤال
Which of the following Scheme statements will insert the number 6 at the head of a list named L?

A) (add 6 L)
B) (insert 6 L)
C) (hd 6 L)
D) (cons 6 L)
سؤال
To express symbols as a data type in Scheme,use the keyword ____.

A) symbol
B) form
C) quote
D) exclamation
سؤال
What is the purpose of a binding list in Scheme?

A) It creates a function.
B) It marks an expression for delayed evaluation.
C) It binds variable names to values.
D) It specifies a list of parameters for a function.
سؤال
Which of the following correctly assigns values to two variables and then multiplies them in the Scheme programming language?

A) (let ((x 5) (y 3)) (* x y))
B) (let (x 5) (y 3)) (* x y)
C) let (x 5) (y 3) (* x y)
D) (let (x 5 y 3) (* x y))
سؤال
Which of the following statements about functional programming languages is incorrect?

A) In pure functional programming, there are no assignments.
B) In pure functional programming, there are no loops.
C) In pure functional programming, loops are replaced by recursive calls.
D) The value of a function depends on the order of evaluation of its parameters.
سؤال
Which of the following represents a list of data in Scheme?

A) (3.1, 3.2, 3.3)
B) (3.1; 3.2; 3.3)
C) (quote (3.1 3.2 3.3))
D) (quote (3.1, 3.2, 3.3))
سؤال
To define a value in the ML programming language,use the ____ keyword.

A) define
B) let
C) letrec
D) val
سؤال
To determine if two lists have the same fringe,we must flatten them to just lists of their atoms.
سؤال
Which of the following statements about Scheme is correct?

A) Scheme function applications use pass by value, while special forms in Scheme use delayed evaluation.
B) Scheme function applications use pass by name, while special forms in Scheme use delayed evaluation.
C) Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation.
D) Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation.
سؤال
The Haskell language requires semicolons and bracketing to resolve ambiguities.
سؤال
Given a list L in Scheme with contents of (3 7 2 8).What will be returned if the command (cdr L)is executed?

A) (8)
B) (3)
C) (2 8)
D) (7 2 8)
سؤال
The essential construct of lambda calculus is called the lambda application.
سؤال
The definition of a language using an interpreter written in the same language is called a ____.

A) metaphysical interpreter
B) metaphysical interpreter
C) metaphorical interpreter
D) metacircular interpreter
سؤال
Given a list L in Scheme with contents of ((x y)s (t)).What will be returned if the command (cdr (car L))is executed?

A) (x)
B) (y)
C) (x y)
D) (t)
سؤال
Haskell supports a type class inheritance through a hierarchy of type classes.
سؤال
Lists that obey lazy evaluation are called serialized lists.
سؤال
The Scheme evaluation rule represents ____ evaluation.

A) applicative order
B) normal order
C) binary order
D) sequential order
سؤال
Which of the following statements about scoping in Scheme is correct?

A) A bound variable is a variable referenced within a function that is not also a formal parameter to that function.
B) A free variable is a variable within a function that is also a formal parameter to that function.
C) A free variable is a variable referenced within a function that is not also a formal parameter to that function.
D) A free variable is one that is bound within a nested function.
سؤال
The ____ is used in Scheme to create a function.

A) let special form
B) letrec special form
C) lambda special form
D) procedure special form
سؤال
In lambda calculus,a conversion that allows for the elimination of redundant lambda abstractions is call ____.

A) eta-conversion
B) alpha-conversion
C) beta-conversion
D) beta-abstraction
سؤال
In lambda calculus,a value can be substituted for a variable by use of a(n)____.

A) reduction rule
B) evaluation rule
C) abstraction rule
D) application rule
سؤال
If the ML command val h::t = [4 5 6]; is executed,what value will t have?

A) [1]
B) [2]
C) [1 2]
D) [2 3]
سؤال
The ____ character in ML indicates a wildcard.

A) hyphen
B) asterisk
C) question mark
D) underscore
سؤال
Standard predefined resources for performing input and output in ML are contained in a ____.

A) package
B) library
C) class
D) structure
سؤال
Which of the following statements is correct?

A) A language with nonstrict functions is easier to implement.
B) A function that will produce well-defined results, even when subexpressions or parameters may be undefined, is said to be strict.
C) Delayed execution can lead to well-defined results, even when subexpressions or parameters may be undefined.
D) Nonstrictness is always an undesirable property in a language.
سؤال
Which of the following statements about lazy evaluation is incorrect?

A) Operations on lists must evaluate the entire list.
B) All arguments to user-defined functions are delayed.
C) All arguments to constructor functions are delayed.
D) All bindings of local names in let and letrec expressions are delayed.
سؤال
Which of the following statements about Haskell is correct?

A) Haskell is a lazy language that is not fully curried.
B) Haskell is a fully curried language that does not do delayed evaluation.
C) Haskell is a fully curried and lazy language.
D) Haskell does not support higher-order functions.
سؤال
In the Haskell language,the ____ character represents the lambda.

A) backslash
B) underscore
C) vertical bar
D) ampersand
سؤال
The ____ character is used for alternative values in the ML programming language.

A) underscore
B) vertical bar
C) ampersand
D) percent sign
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Functional Programming
1
In Scheme,a let special form can be used to define a recursive function.
False
2
Scheme expressions must be written in prefix form.
True
3
The semantics of Scheme uses static type checking.
False
4
Scheme expressions that begin with keywords are called control forms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
The ML programming language is strongly typed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
The simplest unit of syntax in Scheme is called an atom.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
A function that takes other functions as parameters or returns a function as a value is called a recursive function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
A function definition describes how a value is to be computed using formal parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
A pure functional program is one that consists only of functions and procedures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
In the ML programming language,a function is declared using the lambda keyword.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
hd is the predefined list function that returns the head of a list in Scheme.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
With static scoping,the meaning of a variable depends on the runtime context.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
The rand function is referentially transparent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
The if form in Scheme is like an if-else construct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
A function application is a call to a defined function using actual parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
The ML programming language has a built-in list reverse function called rev.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
A language is considered to be fully curried if function definitions are treated as curried and if all multiparameter built-in functions are curried.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
A Scheme compiler will translate a tail recursive function into code that executes as a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
In Scheme,the letrec form makes a global binding of a variable visible in the top-level environment.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
In ML,arithmetic operators are written as infix operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following represents a list in ML?

A) (1 2 3)
B) {1 2 3}
C) [1, 2, 3]
D) (1, 2, 3)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following Scheme statements will insert the number 6 at the head of a list named L?

A) (add 6 L)
B) (insert 6 L)
C) (hd 6 L)
D) (cons 6 L)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
To express symbols as a data type in Scheme,use the keyword ____.

A) symbol
B) form
C) quote
D) exclamation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
What is the purpose of a binding list in Scheme?

A) It creates a function.
B) It marks an expression for delayed evaluation.
C) It binds variable names to values.
D) It specifies a list of parameters for a function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following correctly assigns values to two variables and then multiplies them in the Scheme programming language?

A) (let ((x 5) (y 3)) (* x y))
B) (let (x 5) (y 3)) (* x y)
C) let (x 5) (y 3) (* x y)
D) (let (x 5 y 3) (* x y))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which of the following statements about functional programming languages is incorrect?

A) In pure functional programming, there are no assignments.
B) In pure functional programming, there are no loops.
C) In pure functional programming, loops are replaced by recursive calls.
D) The value of a function depends on the order of evaluation of its parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following represents a list of data in Scheme?

A) (3.1, 3.2, 3.3)
B) (3.1; 3.2; 3.3)
C) (quote (3.1 3.2 3.3))
D) (quote (3.1, 3.2, 3.3))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
To define a value in the ML programming language,use the ____ keyword.

A) define
B) let
C) letrec
D) val
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
To determine if two lists have the same fringe,we must flatten them to just lists of their atoms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
Which of the following statements about Scheme is correct?

A) Scheme function applications use pass by value, while special forms in Scheme use delayed evaluation.
B) Scheme function applications use pass by name, while special forms in Scheme use delayed evaluation.
C) Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation.
D) Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
The Haskell language requires semicolons and bracketing to resolve ambiguities.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Given a list L in Scheme with contents of (3 7 2 8).What will be returned if the command (cdr L)is executed?

A) (8)
B) (3)
C) (2 8)
D) (7 2 8)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
The essential construct of lambda calculus is called the lambda application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
The definition of a language using an interpreter written in the same language is called a ____.

A) metaphysical interpreter
B) metaphysical interpreter
C) metaphorical interpreter
D) metacircular interpreter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
Given a list L in Scheme with contents of ((x y)s (t)).What will be returned if the command (cdr (car L))is executed?

A) (x)
B) (y)
C) (x y)
D) (t)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
Haskell supports a type class inheritance through a hierarchy of type classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Lists that obey lazy evaluation are called serialized lists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
The Scheme evaluation rule represents ____ evaluation.

A) applicative order
B) normal order
C) binary order
D) sequential order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Which of the following statements about scoping in Scheme is correct?

A) A bound variable is a variable referenced within a function that is not also a formal parameter to that function.
B) A free variable is a variable within a function that is also a formal parameter to that function.
C) A free variable is a variable referenced within a function that is not also a formal parameter to that function.
D) A free variable is one that is bound within a nested function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
The ____ is used in Scheme to create a function.

A) let special form
B) letrec special form
C) lambda special form
D) procedure special form
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
In lambda calculus,a conversion that allows for the elimination of redundant lambda abstractions is call ____.

A) eta-conversion
B) alpha-conversion
C) beta-conversion
D) beta-abstraction
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
In lambda calculus,a value can be substituted for a variable by use of a(n)____.

A) reduction rule
B) evaluation rule
C) abstraction rule
D) application rule
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
If the ML command val h::t = [4 5 6]; is executed,what value will t have?

A) [1]
B) [2]
C) [1 2]
D) [2 3]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
The ____ character in ML indicates a wildcard.

A) hyphen
B) asterisk
C) question mark
D) underscore
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
Standard predefined resources for performing input and output in ML are contained in a ____.

A) package
B) library
C) class
D) structure
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following statements is correct?

A) A language with nonstrict functions is easier to implement.
B) A function that will produce well-defined results, even when subexpressions or parameters may be undefined, is said to be strict.
C) Delayed execution can lead to well-defined results, even when subexpressions or parameters may be undefined.
D) Nonstrictness is always an undesirable property in a language.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which of the following statements about lazy evaluation is incorrect?

A) Operations on lists must evaluate the entire list.
B) All arguments to user-defined functions are delayed.
C) All arguments to constructor functions are delayed.
D) All bindings of local names in let and letrec expressions are delayed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the following statements about Haskell is correct?

A) Haskell is a lazy language that is not fully curried.
B) Haskell is a fully curried language that does not do delayed evaluation.
C) Haskell is a fully curried and lazy language.
D) Haskell does not support higher-order functions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
In the Haskell language,the ____ character represents the lambda.

A) backslash
B) underscore
C) vertical bar
D) ampersand
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
The ____ character is used for alternative values in the ML programming language.

A) underscore
B) vertical bar
C) ampersand
D) percent sign
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.