What is the output of the given statement?
* (defstruct person (sex nil) (personality ‘nice))
* (setf person-instance-1 (make-person))
* (setf person-instance-2 (make-person :sex ‘female))
* (person-personality person-instance-2)
a) Female
b) Nice
c) Person
d) Both a & b



 What is the output of the given statement? * (defstruct person (sex nil) (personality ‘..

Answer / chaitanya

b

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?

1 Answers  


 What is the output of the given statement? * (defstruct person (sex nil) (personality ‘nice)) * (setf person-instance-1 (make-person)) * (setf person-instance-2 (make-person :sex ‘female)) * (person-personality person-instance-2) a) Female b) Nice c) Person d) Both a & b

1 Answers  


 Which can build new lists by depositing pointers in free boxes? a) Do b) Dobuild c) Cons d) None of the mentioned

1 Answers  


 What is the output of the following statement? * (setf x ‘outside) * (let ((x ‘inside) (y x)) (list x y)) a) Outside b) Inside c) Inside Outside d) Outside Inside

1 Answers  


 How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6

1 Answers  






 Explain what is recursion in Prolog?

1 Answers  


Explain what is LISP? Give an example of some of the popular applications built in LISP?

1 Answers  


What is the output of the following statement? * (defun (input-list) (if (endp input-list) nil (cons ( (first input-list)) ( (rest input-list))))) a) Procedure b) Transforming c) Input d) Error

1 Answers  


 What is the output of the given statement? * (setf pressure 3) * (when-plusp pressure (print ‘alarm)); a) Alarm b) Alarm Alarm c) 1 d) Nil

1 Answers  


 What is the output of the given statement? * (defstruct circle (radius 0)) * (defun area (figure) (cond ((circle-p figure) (* pi (expt (circle-radius figure) 2))))) * (setf circle (make-circle :radius 11)) * (area circle) a) 44 b) 380 c) 382 d) 380.132

1 Answers  


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

1 Answers  


 Which primitive removes all but the last element from the list? a) Last b) First c) Remove d) Revoke

1 Answers  


Categories