CSCI 461 - Unit 2 Concepts Exam
Questions With 100% Verified Answers
variable -
correct answer ✅is a pattern that matches anything and binds to it
underscore ( _ ) -
correct answer ✅is a pattern that matches to anything
constant (of an equality type) -
correct answer ✅is a pattern that matches only that constant
value
tuple of patterns -
correct answer ✅a pattern that matches any tuple of the right size,
whose contents match the subpatterns
list of patterns -
correct answer ✅a pattern that matches any list of the right size,
whose contents match the subpatterns
cons of patterns -
correct answer ✅a pattern that matches any non-empty list whose
head and tail match the subpatterns
, CSCI 461 - Unit 2 Concepts Exam
Questions With 100% Verified Answers
overloaded function name or operator -
correct answer ✅one that has at least two definitions, all of
different types
int square (int x) {
return x * x;
}
double square (double x) {
return x * x;
}
coercion -
correct answer ✅an implicit type conversion
double x;
x = 2;
coercion implicitly converts the integer 2 to the double value 2.0
Questions With 100% Verified Answers
variable -
correct answer ✅is a pattern that matches anything and binds to it
underscore ( _ ) -
correct answer ✅is a pattern that matches to anything
constant (of an equality type) -
correct answer ✅is a pattern that matches only that constant
value
tuple of patterns -
correct answer ✅a pattern that matches any tuple of the right size,
whose contents match the subpatterns
list of patterns -
correct answer ✅a pattern that matches any list of the right size,
whose contents match the subpatterns
cons of patterns -
correct answer ✅a pattern that matches any non-empty list whose
head and tail match the subpatterns
, CSCI 461 - Unit 2 Concepts Exam
Questions With 100% Verified Answers
overloaded function name or operator -
correct answer ✅one that has at least two definitions, all of
different types
int square (int x) {
return x * x;
}
double square (double x) {
return x * x;
}
coercion -
correct answer ✅an implicit type conversion
double x;
x = 2;
coercion implicitly converts the integer 2 to the double value 2.0