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-p ‘(this is a list — not a person instance))
a) Female
b) Nice
c) T
d) Nil



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

Answer / chaitanya

d

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

What is the output of the given statement? * (defclass article() ((title :accessor article-title :initarg :title) (author :accessor article-author :initarg :author))) * (defclass computer-article (article) ()) * (defclass business-article (article) ()) * (defclass political-article (article) ()) * (setf articles (list (make-instance ‘business-article :title “Memory Prices down”))) a) Business article b) Political article c) Business article

0 Answers  


What is the output of the following statement? * (setf thing ‘point r 1) * (case thing (circle (*pi r r))(sphere (* 4 pi r r))) a) 1 b) 12.56637 c) NIL d) T

1 Answers  


 Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None 

1 Answers  


Which is present in the writer procedure for arrays in LISP? a) Setf b) Aref c) Fref d) Both a & b

1 Answers  


Explain List of programming languages for artificial intelligence?

0 Answers  






Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?

1 Answers  


Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned

1 Answers  


 What is the output of the following statement? * ‘(first (first (rest (rest ((a b) (c d) (e f)))))) a) a b) b c) ab d) (FIRST (FIRST (REST (REST ((A B) (C D) (E F))))))

1 Answers  


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

1 Answers  


 Which require sophisticated precedence compputation? a) Superclass b) Multiple Superclass c) Subclass d) None of the mentioned

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  


 Explain why matching variable is important in Prolog? What is the method to match variables?

1 Answers  


Categories