1/60
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
c
(cons 'a 'b) will result in:
A. '(a b ())
B. '((a) b)
C. '(a . b)
D. '(a b)
d
(cons '(a) '(b)) will result in:
A. '(a b ())
B. '((a) b)
C. '(a . b)
D. '( a b)
d
(cons 'a '(b)) will result in:
A. '(a b ())
B. '((a) b)
C. '(a . b)
D. '(a b)
b
(car (cdr '( a b (c d e) f (g h i)))) will result in:
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
c
(car (cdr (cdr '(a b (c d e) f (g h i))))) will result in:
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
a
(cdr (cdr (cdr (cdr '(a b (c d e) f (g h i))))))
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
d
Recursion is to Scheme as ____ are to Java.
A. arrays
B. expressions
C. functions
D. loops
b
Tail recursion requires functions to:
A. do significant processing after calling other functions
B. return to their caller as the very last thing they do
C. have one return statement at the very end of their code
D. do no significant processing after calling another function
c
Scheme allows nameless functions by using:
A. cond
B. define
C. lambda
D. '()
b
(pair? x) returns #t when:
A. the length of x is exactly 2
B. (car x) and (cdr x) are defined
C. (car x) and (cdr x) are the same S-expression
D. the first two elements of x are the same
d
What will appear on the console for the JavaScript code below?
arr=[];
arr[10]=1;
console.log(arr["5"]);
A. exception
B. 5
C. 1
D. undefined
b
The difference between actual parameters and formal parameters is:
A. actuals are call-by-value, formal are call-by-name
B. actuals are in the caller, formals are in the called subprogram
C. actuals are in the called subprogram, formals are in the caller
D. no difference
b
Omitting the "new" on a call to an intended construct will bind "this" to:
A. an array of arguments
B. the global object
C. the last instance created by this constructor
D. the prototype
c
Static chain links go through which type of allocation?
A. static
B. heap
C. stack
D. registers
a
(cdr (cdr (cdr (cdr '(a b (c d e) f (g h i))))))
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
d
A thrown JavaScript exception may be:
A. a string
B. a declared exception type
C. a number
D. any of these
c
Exceptions may be implemented in Scheme by using
A. closures
B. cond
C. continuations
D. set!
c
(car (cdr (cdr '(a b (c d e) f (g h i)))))
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
a
Which of the following is a JavaScript type?
A. boolean
B. char
C. int
D. real
a
JavaScript makes a simple stack available through:
A. array methods
B. prototypal inheritance
C. cloning the stack class
D. closure
d
Keyword parameters give flexibility in:
A. achieving overloading
B. making call-by-name work effectively
C. overriding the reserved words of a language
D. the order in which parameters are passed
a
The difference between actual parameters and formal parameters is:
A. actuals are in the caller, formals are in the called subprogram
B. actuals are in the called subprogram, formals are in the caller
C. actuals are call-by-value, formals are call-by-name
D. no difference
d
PL/0 uses static links to:
A. Update the display table
B. Return from a called procedure
C. Place an integer on the stack
D. Reference data
b
PL/0 uses dynamic links to:
A. Update the display table
B. Return from a called procedure
C. Place an integer on the stack
D. Reference Data
b
(cons (car (cdr '(h (i j k) l m))) (cdr '(d e(g f) (a b c)))) will result in:
A. '((e (g f) (a b c)) i j k)
B. '((i j k) e (g f) (a b c))
C. '(((g f) (a b c)) i j k)
D. '((i j) e (g f) (a b c))
a
(car (cons (car (cdr '(a (b c) (d e)))) (cdr '(((f g)) h i (j k))))) will result in:
A. '(b c)
B. '((b c))
C. '(d e f g)
D. '((b c) h i (j k))
c
Continuations could be viewed as being a generalization of:
A. activation records
B. combinator
C. exceptions
D. functions
a
Call-by-name is associated with which language?
A. ALGOL 60
B. C
C. JavaScript
D. Pascal
b
## may be used in a C macro to:
A. apply the macro in a call-by-name fashion
B. concatenate tokens
C. simulate Pascal var argument passing
D. stringify tokens
b
The static link and dynamic link for an activation record will be the same when:
A. never
B. a procedure has called itself
C. the call is from a nested procedure
D. in all cases
c
What will appear on the console for the JavaScript code below?
arr=[];
arr[10]=1;
console.log(arr["10"];
A. exception
B. 5
C. 1
D. undefined
c
The difference between actual parameters and formal parameters is:
A. actuals are in the called subprogram, formals are in the caller
B. actuals are call-by-value, formals are call-by-name
C. actuals are in the caller, formals are in the called subprogram
D. no difference
b
PL/0 uses static links to:
A. Place an integer on the stack
B. Reference data
C. Update the display table
D. Return from a called procedure
d
PL/0 uses dynamic links to:
A. Place an integer on the stack
B. Reference Data
C. Update the display table
D. Return from a called procedure
a
(cons (cdr '(d e (g f) (a b c))) (car (cdr '(h (i j k) l m)))) will result in:
A. '((e (g f) (a b c)) i j k)
B. '((i j k) e (g f) (a b c))
C. '(((g f) (a b c)) i j k)
D. '((i j) e (g f) (a b c))
c
(cons (cdr '(e (g f) (a b c))) (car (cdr '(h (i j k) l m)))) will result in:
A. '((e (g f) (a b c)) i j k)
B. '((i j k) e (g f) (a b c))
C. '(((g f) (a b c)) i j k)
D. '((i j) e (g f) (a b c))
d
Which language's operator precedences have the least similarity to the other three?
A. C
B. Java
C. JavaScript
D. Pascal
a
Overloading operators may be done in which language?
A. C++
B. Java
C. JavaScript
D. C
a
The value resulting from !!(4/2) in JavaScript will be
A. true
B. false
C. 2
D. undefined
the argument is evaluated every time it is used
What is call-by-name?
d
The lambda calculus is a major influence on which language?
A. C
B. Java
C. Pascal
D. Scheme
c
The difference between actual parameters and formal parameters is:
A. actuals are in the called subprogram, formals are in the caller
B. actuals are call-by-value, formal are call-by-name
C. actuals are in the caller, formals are in the called subprogram
D. no difference
taking a value and passing a copy of that value to the function
What is call-by-value?
b
Duff's device involves which PL construct?
A. C union
B. C Switch
C. Java Switch
D. C varargs
a
Static chain links go through which type of allocation?
A. stack
B. heap
C. static
D. registers
c
(car (cdr (cdr '(a b (c d e) f (g h i)))))) will result in:
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
a
(cdr (cdr (cdr (cdr '(a b (c d e) f (g h i))))))) will result in:
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
d
A thrown JavaScript exception may be:
A. a string
B. a declared exception type
C. a number
D. any of these
a
Call-by-name is associated with which language?
A. ALGOL 60
B. ALGOL 68
C. JavaScript
D. Pascal
b
The Y combinator is useful for:
A. anonymous functions
B. continuations
C. threads
D. unary functions
d
Keyword parameters give flexibility in:
A. achieving overloading
B. making call-by-name work effectively
C. overriding the reserved words of a language
D. the order in which parameters are passed
d
For which of these languages is there a significant difference between "for" and "while" loops?
A. C
B. Java
C. JavaScript
D. Pascal
d
Keyword parameters give flexibility in:
A. achieving overloading
B. making call-by-name work effectively
C. overriding the reserved words of a language
D. the order in which parameters are passed
d
Beside a switch statement, Duff's device also involves which C construct?
A. break
B. continue
C. goto
D. loop
a
The cost of addressing a variable in PL/0 is linear in:
A. level difference
B. number of entries in the display
C. scope level of the instruction
D. scope level of the variable
c
(cons (cdr '(e (g f) (a b c))) (car (cdr '(h (i j k) l m)))) will result in:
A. '((e (g f) (a b c)) i j k)
B. '((i j k) e (g f) (a b c))
C. '(((g f) (a b c)) i j k)
D. '((i j) e (g f) (a b c))
a
(cdr (cdr (cdr (cdr '(a b (c d e) f (g h i))))))
A. '((g h i))
B. 'b
C. '(c d e)
D. '(g h i)
b
The for .. in construct is used to:
A. enumerate array elements that are not undefined
B. enumerate properties
C. test a subclass/superclass relationship
D. iterate over an integer subrange
b
Call-by-name is most similar to application of:
A. #include
B. macro
C. r-value
D. recursion
b
The state of a Scheme computation may be saved as:
A. an anonymous function
B. a continuation
C. a fixed point
D. a thread
d
PL/0 uses dynamic links to:
A. Place an integer on the stack
B. Reference data
C. Update the display table
D. Return from a called procedure