Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which is uses their arguments to build intermediate forms and evaluating them to produce a value?
a) Backquote
b) Macros
c) List
d) Procedures

View Answer

Answer: b [Reason:] Macro use their arguments to build intermediate forms and it evaluate the intermediate form to produce a value.

2. Which keyword is used to define macro procedures?
a) Defun
b) Demacro
c) Defmacro
d) None of the mentioned

View Answer

Answer: c [Reason:] Defmacro can be used to define procedure called macro procedure.

3. Which do not evaluate their arguments?
a) List
b) Procedure
c) Setf
d) Macros

View Answer

Answer: d [Reason:] None.

4. What is the difference between the appearance of macro and ordinary definition?
a) Argument list
b) Reture value
c) Just the defining keyword
d) None of the mentioned

View Answer

Answer: c [Reason:] The only difference between the appearance of macro and ordinary definition is that one uses defmacro and other uses defun.

5. Which forms can be constructed with the same primitives that manipulate lisp expressions?
a) Lisp
b) Macro
c) Procedure
d) Defun

View Answer

Answer: a [Reason:] Lisp forms can be constructed with the same primitives that generally manipulate lisp expressions.

6. Which exploit the fact that lisp forms are just expressions meant to be evaluated?
a) List
b) Procedure
c) Macro
d) None of the mentioned

View Answer

Answer: c [Reason:] None.

7. Pick out the correct statement about macro.
a) Macro is dependant.
b) Macro is interoperable
c) Macro is complex
d) Macro deserve their own file

View Answer

Answer: d [Reason:] Macro deserve their own file for compiling them.

8. What is the output of the given statement?

span class="sy0"> * (setf pressure -3)
* (when-plusp pressure (print 'alarm));

a) T
b) Nil
c) Alarm
d) None of the mentioned

View Answer

Answer: b [Reason:] This statement will print nil because of the negative number. Output: NIL

9. What is the output of the given statement?

span class="sy0"> * (setf pressure 3)
* (when-plusp pressure (print 'alarm));

a) Alarm
b) Alarm
Alarm
c) 1
d) Nil

View Answer

Answer: b [Reason:] This statement will print alarm twice because of the positive number. Output: ALARM ALARM

10. What is the output of the given statement?

span class="sy0"> * (defun when-plusp-with-bug (number result);
  (when (plusp number) result));
span class="sy0"> * (setf pressure -2)
* (when-plusp-with-bug pressure (print 'alarm))

a) Alarm
b) Nil
c) Both Alarm & Nil
d) None of the mentioned

View Answer

Answer: c [Reason:] This statement will print alarm and nil because of the definition. Output: ALARM NIL