This set of LISP Multiple Choice Questions & Answers (MCQs) focuses on “Backquote”.
1. Which mechanism makes it easy to create and to complete template like expressions?
a) Macro
b) Backquote
c) Variable
d) None of the mentioned
View Answer
Explanation: Backquote mechanism makes it easy to create and to complete template like expressions in which only a few, variable details to be filled.
2. Which isolates an entire expression from evaluation?
a) ‘
b) ”
c) ()
d) $
View Answer
Explanation: The normal quote, ‘ isolates an entire expression from evaluation.
3. Which are perfect for making and filling using backquote mechanism?
a) Templates
b) Macro templates
c) List
d) Procedure
View Answer
Explanation: The backquote mechanism is perfect for making and filling macro templates.
4. Which is used to spliced the elements in the list?
a) #
b) %
c) @
d) None of the mentioned
View Answer
Explanation: The elements in the list are spliced into the list when the @ appears.
5. Which simplifies the macro writing?
a) Macros
b) List
c) Backquote mechanism
d) None of the mentioned
View Answer
Explanation: The backquote mechanism simplifies macro writing.
6. What is the output of the given statement?
span class="sy0"> * (setf variable 'test) * ('(THIS IS A ,VARIABLE)
a) Test
b) Variable
c) This is a variable
d) This is a test
View Answer
Explanation: This statement will create an backquote on the name of variable.
Output:
(THIS IS A TEST)
7. What is the output of the given statement?
span class="sy0"> * (setf variable '(more difficult example)) * '(this is a ,variable)
a) This is a more difficult example
b) This is a (more difficult example))
c) This is a
d) None of the mentioned
View Answer
Explanation: This statement will create an backquote under the name variable and make it to process.
Output:
(THIS IS A (MORE DIFFICULT EXAMPLE))
8. What is the output of the given statement?
span class="sy0"> * (setf exam '(Steve jobs) * '(Apple has been invented by ,@exam)
a) Apple has been
b) Apple has been invented by
c) Apple has been invented by steve jobs
d) None of the mentioned
View Answer
Explanation: This statement will slice the statement for inserting steve jobs.
Output:
(APPLE HAS BEEN INVENTED BY STEVE JOBS)
9. What is the output of the given statement?
span class="sy0"> * (setf precious '(time) * '(Time is precious)
a) Time is precious
b) Time is time
c) Time
d) All of the mentioned
View Answer
Explanation: As the second statement does not contains comma, it will print time is precious.
10. Which will be simplified by using backquote mechanism?
a) Time
b) Memory space
c) Error
d) Template filling
View Answer
Explanation: The backquote mechanism will simplify template filling.
Sanfoundry Global Education & Learning Series – LISP Programming Language.
To practice all areas of LISP, here is complete set of 250+ Multiple Choice Questions and Answers on LISP Programming Language.
- Check LISP Books
- Apply for Computer Science Internship
- Practice Computer Science MCQs
- Check Computer Science Books