Demonstrate with an example how you can code in LISP?
Answer / chaitanya
Almost everything in LISP is a function, even the mathematical operators.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the output of the given statement? * (evenp (* 10 8 6 4 2)) a) T b) F c) NIL d) All of the mentioned
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
What is the output of the following statement? *(setf thing ‘sphere r 1) * (cond ((eq thing ‘circle) (* pi r r)) ((* 4 pi r r))) a) 10.566 b) 11.5683 c) 12.56637 d) 13
Mention what is Cut (!) in Prolog and what is the advantage of ‘Cut’ and ‘Negation’?
Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers
Which makes it possible to define generic functions? a) Lisp b) CLOS c) Class d) Object-Oriented programming
Which creates reader procedures for getting things out of an instance fields? a) Structure in LISP b) Defstruct c) Class d) Object
Explain what is LISP? Give an example of some of the popular applications built in LISP?
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
Explain with an example what is “Setof” predicate in Prolog?
What is a symbol thought of as a name for a place to store value? a) Data b) Variable c) Parameters d) None of the mentioned
What is the programming structure for LISP?