


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of exercises and solutions related to clojure programming, focusing on recursion, namespaces, and library definitions. It covers key concepts like recursion, tail-call optimization, namespace definition, and importing java classes into clojure code. Valuable for students learning clojure programming, offering practical examples and explanations.
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



No - correct answer ✔✔For/while loop version in Clojure Recursion - correct answer ✔✔What do we use to perform iterative processing (replacement for/while loop)
(conj (flip (rest numbers)) (first numbers) ))) - correct answer ✔✔Code to reverse the values in a vector of ints? By combining recursion with multi-arity methods - correct answer ✔✔How can you get more sophisticated results with recursion When one needs to initialize a value in just one instance of a function invocation - correct answer ✔✔When is it necessary to combine recursion with multi-arity methods in order By making a recursive call - correct answer ✔✔How can basic recursion be implemented When the recursion is the last expression in the function - correct answer ✔✔When is it recommended to use the recur function no - correct answer ✔✔Does Clojure directly support ''tail-call'' optimization Because Clojure doesn't support ''tail-call'' optimization - correct answer ✔✔Why a large number of stack frames can be created in Clojure tail-call recursions are transformed into something resembling a while loop, this uses a constant amount of stack space and is far more memory efficient - correct answer ✔✔What does the recur function do a default namespace called 'user' - correct answer ✔✔Clojure will associate your code to A collection of functions - correct answer ✔✔Library def in CLojure Java package - correct answer ✔✔CLojure library equivalent to Java's... once - correct answer ✔✔How many times will a library be processed
/ - correct answer ✔✔What do you use to separate thhe namespace path from the function :as - correct answer ✔✔Abbreviation for the namespace path in a single symbol When additional options are included - correct answer ✔✔When are [] required for namespace abbreviation Because we now have a vector of specification elements - correct answer ✔✔Why are [] necessary for namespace abbreviation :refer option - correct answer ✔✔How do you eliminate the need to fully qualify specific functions by using the yes - correct answer ✔✔Can you import Java classes into your Clojure Code using :import instead of :require - correct answer ✔✔How to import Java classes into Clojure code instantiates an object - correct answer ✔✔What does Date. do