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 following statement? * (setf breakfast ‘(eggs bacon toast tea)) * (cond ((> (length breakfast) 10) ‘glutton) ((not (endp breakfast)) ‘normal)(t ‘anorexic)) a) Anorexic b) Breakfast c) Eggs d) Normal
What is the process of reserving a place in computer memory to store a value for a symbol? a) Storing b) Ranging c) Binding d) None of the mentioned
Which checks the evaluated key form against the unevaluated keys using EQL? a) COND b) CASE c) NIL d) SETF
What is the output of the given statement in LISP? * (setf bins (make-array 2 :initial-element ‘e)) a) E b) E E c) E E E d) E E E E
Which primitive removes all but the last element from the list? a) Last b) First c) Remove d) Revoke
Which forms can be constructed with the same primitives that manipulate lisp expressions? a) Lisp b) Macro c) Procedure d) Defun
What is the output of the following statement? * (setf whole-list ‘(monday tuesday wednesday thursday friday)) * (defun both-ends ()(setf whole-list (cons (first whole-list) (last whole-list)))) a) Monday b) BOTH-ENDS c) Friday Monday d) Monday Friday
Mention what is Cut (!) in Prolog and what is the advantage of ‘Cut’ and ‘Negation’?
Which is a procedures supplied by user in terms of primitives? a) Custom b) User-defined c) Definite d) All of the mentioned
What will happen if the value of all the test-forms are nil? a) Nothing b) COND form is nil c) Both a & b d) None of the mentioned
How data types are categorized in LISP?
Explain what is CLOS in LISP? What are the goals of the common lisp object system?