Clojure is based on which programming Lanuage?
LISP
Clojure is a general-purpose language supporting interactive development that
encourages a ______ style and simplifies multi-threading programming.
functional programming
What is the plugin used in Eclipse IDE to run Clojure?
CounterClockWise
LISP and LISP derived languages are homoiconic.
True
Which of these is the file extension for Clojure?
.clj
Who designed Clojure?
Rich Hickey
Clojure runs on which Platform?
Java Virtual Machine
What does Nil represent in Clojure?
Null Value
Which keyword is used to define a value in Clojure?
def
Which of the following is the correct syntax of clojure?
(println "Hello World")
Which of the following is correct Clojure syntax?
(read-string “(+ 1 2)”)
Valid s-expressions are called as forms?
True
What does REPL stand for?
Read Eval Print Loop
Clojure follows an operator precedence similar to that of Java?
False
Which of the following keyword is used to evaluate a form?
eval
What will be the output of the following expression?
(println (set '(1 1 2 2)))
#{1,2}
What is the output of the following expression?
(println (nth (vector 1,2,3) 0))
1
What will be the output of the following expression?
(def items (sorted-map "z" "1" "b" "2" "a" "3"))(println items)
{a 3, b 2, z 1}
Which of these is the basic syntax to create atoms?
(def (atom 1))
Which of the following contain only unique values?
sets
The clojure sequences implement which interface?
Iseq
Clojure functions are first class functions.
True
Which of the following is used to iterate over a sequence?
doseq
What is arity of a function?
numbers of arguments
Which of the following is the chracteristics of lazy sequences?
computed only when needed
What are variadic functions?
function with any number of arguments
Vectors and Sets are Sequences.
False
Which keyword is used to define function?
defn
What are Higher-order functions?
functions that take other functions as arguments
To write files one line at a time, we can use [Link] class.
True
Which of the following is used to read entire file as a single string?
[Link]
In Clojure, exceptional handling is similar to java.
True
Which of the following command is used to read data from console?
Read-line
In Clojure, exceptions are thrown using which keyword?
asert
Which of the following command is used to write a single String Sequence at a time
we use?
[Link]
Which modification operation is used frequently with atom to update its value?
swap!
Which one is the reference types in clojure?
atoms
To implement concurrency, Clojure implements _________.
STM
Macros make Clojure __________.
Dynamic and lightweight
Which function is used is to expand macro?
macroexpand and macroexpand-1
Which macro is used to define a task without having to execute it or requiring the
result immediately?
delays
Which one is the correct syntax?
(defmacro name [params*] body)
Which is the function used to define a macro?
defmacro
What are the three events bind together in clojure code?
definition,execution,task result
What are the characteristics of “Ref”?
synchronous co-ordinated
Light weight sub-processes witin a process are called _______.
Thread
Which is the correct syntax to define a macro?
(defmacro name [params*] body)
First Class functions are the functions that _____.
Have return type -- wrong
What are the different parallelism tools in Clojure?
Future, Promises and Delays
Which function is used to deliver the result created by promisefunction?
deliver
Which macro is used to define a task and place it in another thread, when the
result is not required immediately?
future
Which of the following flow control statements is used to iterate over a sequence?
doseq
What is the name of the plugin used to run Clojure on intelliJ IDE?
Leiningen -- wrong
Anonymous functions are defined using which keyword?
fn
Pure functions give the same result for the same argument values.
True
Macros are alternatives to functions?
False
Which function is used to display all the elements except the first element in a
sequence?
rest
Which of these is not a feature of Clojure?
Immutable data -- wrong
Why loops do not work in Clojure?
Tail recursion consumes stack as well as variables are immutable
Software Transactional Memory is used to implement _______.
Concurrency
What is the output of the following?
(seq? (list '1 '2 '3))
True