LISP Questions & Answers – Backquote

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

Answer: b
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

Answer: a
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

Answer: b
Explanation: The backquote mechanism is perfect for making and filling macro templates.
advertisement
advertisement

4. Which is used to spliced the elements in the list?
a) #
b) %
c) @
d) None of the mentioned
View Answer

Answer: c
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

Answer: c
Explanation: The backquote mechanism simplifies macro writing.
Note: Join free Sanfoundry classes at Telegram or Youtube

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

Answer: d
Explanation: This statement will create an backquote on the name of variable.
Output:
(THIS IS A TEST)
advertisement

7. What is the output of the given statement?

advertisement
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

Answer: b
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

Answer: c
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

Answer: a
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

Answer: d
Explanation: The backquote mechanism will simplify template filling.

Sanfoundry Global Education & Learning Series – LISP Programming Language.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.