|Lisp Programming Interview Questions & Answers - Learning Mode|
PROGRAMMING LANGUAGES INTERVIEW QUESTIONS
LISP PROGRAMMING INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE
Lisp Programming Interview Questions & Answers - Learning Mode
LISP, an acronym for list processing, is a programming language that was designed for easy manipulation of data strings. Developed in 1959 by John McCarthy, it is a commonly used language for artificial intelligence (AI) programming. It is one of the oldest programming languages still in relatively wide use. Lisp is the second-oldest high-level programming language after Fortran and has changed a great deal since its early days, and a number of dialects have existed over its history.
|Try Lisp Programming Interview Questions & Answers - Exam Mode|
1Sort By : Latest First | Oldest First | By Rating
|Lisp Programming Interview Questions & Answers - Learning Mode|
|Try Lisp Programming Interview Questions & Answers - Exam Mode|
Question: Why use LISP?
Answer: In short, no single improvement you can make to your AutoCAD system will save you more time, effort, and money. You can spend thousands on the latest generation computers, the fastest video cards, and so on, but that won't make nearly as big a difference as automating your system with software. With an arsenal of LISP routines, you will send accuracy, consistency, and productivity soaring while greatly reducing the stress and strain of CAD operation. The right software is the key, and there Source: CoolInterview.com
Question: What is the ouput like?
Answer: LG3 writes easy-to-read, fully indented AutoLISP programs loaded with detailed comments in English that explain what all of the LISP code is doing. The files are standard ".LSP" files. You can view, edit, or print them with any editor, and run them on any AutoCAD system with or without the Generator. Source: CoolInterview.com
Question: What is the "minimal" set of primitives needed for a Lisp interpreter?
Answer: Many Lisp functions can be defined in terms of other Lisp functions.
For example, CAAR can be defined in terms of CAR as
(defun caar (list) (car (car list)))
It is then natural to ask whether there is a "minimal" or smallest set
of primitives necessary to implement the language.
There is no single "best" minimal set of primitives; it all depends on
the implementation. For example, even something as basic as numbers
need not be primitive, and can be represented as lis Source: CoolInterview.com
Question: How do I determine if a file is a directory or not? How do I get the current directory name from within a Lisp program? Is there any way to create a directory?
Answer: There is no portable way in Common Lisp of determining whether a file
is a directory or not. Calling DIRECTORY on the pathname will not
always work, since the directory could be empty. For UNIX systems
(defun DIRECTORY-P (pathname)
(probe-file (concatenate 'string pathname "/.")))
seems to work fairly reliably. (If "foo" is a directory, then "foo/."
will be a valid filename; if not, it will return NIL.) This won't, of
course, work on the Macintosh, or on oth Source: CoolInterview.com
Question: What is the purpose of this newsgroup?
Answer: The newsgroup comp.lang.lisp exists for general discussion of
topics related to the programming language Lisp. For example, possible
topics can include (but are not necessarily limited to):
announcements of Lisp books and products
discussion of programs and utilities written in Lisp
discussion of portability issues
questions about possible bugs in Lisp implementations
problems porting an implementation to some architecture
Postings should be of general inte Source: CoolInterview.com
Question: How do I call non-Lisp functions from Lisp?
Answer: Most Lisp implementations for systems where Lisp is not the most common
language provide a "foreign function" interface. As of now there has been
no significant standardization effort in this area. They tend to be
similar, but there are enough differences that it would be inappropriate to
try to describe them all here. In general, one uses an
implementation-dependent macro that defines a Lisp function, but instead of
supplying a body for the function, one supplies the name o Source: CoolInterview.com
Question: Where did Lisp come from?
Answer: John McCarthy developed the basics behind Lisp during the 1956 Dartmouth
Summer Research Project on Artificial Intelligence. He intended it as an
algebraic LISt Processing (hence the name) language for artificial
intelligence work. Early implementations included the IBM 704, the IBM
7090, the DEC PDP-1, the DEC PDP-6 and the DEC PDP-10. The PDP-6 and
PDP-10 had 18-bit addresses and 36-bit words, allowing a CONS cell to
be stored in one word, with single instructions to extract Source: CoolInterview.com
Question: What if I get interrupted?
Answer: You are free to come and go from the LISP Generator and do whatever you want in AutoCAD while you are in the middle of creating a program. There are helpful tools in case you forget things like the names of variables you defined. Source: CoolInterview.com
Question: How complex can I get?
Answer: If you want, extremely complex. The LISP Generator utilizes nearly the entire AutoLISP language. There's no limit to how large your programs can be, and no limit to how complex they can be either. Even though most programs can be written in a straightforward or "linear" manner, you have the option to write highly embedded code. You can nest multiple IF and LOOP statements within each other. Also, you can always feed complex operations or math equations as direct input to larger operations, w Source: CoolInterview.com
Question: How can I have two Lisp processes communicate via unix sockets?
Answer: CLX uses Unix sockets to communicate with the X window server. Look at
the following files from the CLX distribution for a good example of
using Unix sockets from Lisp:
defsystem.lisp Lucid, AKCL, IBCL, CMU.
socket.c, sockcl.lisp AKCL, IBCL
excldep.lisp Franz Allegro CL
You will need the "socket.o" files which come with Lucid and Allegro.
To obtain CLX, see the entry for CLX in the answer to question [7-1].
See the file so Source: CoolInterview.com
Question: How can I improve my Lisp programming style and coding efficiency?
Answer: There are several books about Lisp programming style, including:
1. Molly M. Miller and Eric Benson
"Lisp Style and Design"
Digital Press, 1990. 214 pages, ISBN 1-55558-044-0, $26.95.
How to write large Lisp programs and improve Lisp programming
style. Uses the development of Lucid CL as an example.
2. Robin Jones, Clive Maynard, and Ian Stewart.
"The Art of Lisp Programming"
Springer-Verlag, 1989. 169 pages Source: CoolInterview.com
Question: What is the difference between Scheme and Common Lisp?
Answer: Scheme is a dialect of Lisp that stresses conceptual elegance and
simplicity. It is specified in R4RS and IEEE standard P1178. (See
the Scheme FAQ for details on standards for Scheme.) Scheme is much
smaller than Common Lisp; the specification is about 50 pages,
compared to Common Lisp's 1300 page draft standard. (See question
[4-10] for details on standards for Common Lisp.) Advocates of Scheme
often find it amusing that the Scheme standard is shorter than the
index to Source: CoolInterview.com
Question: Lisp books, introductions, documentation, periodicals, journals, and conference proceedings.
Answer: There are several good Lisp introductions and tutorials:
1. David S. Touretzky
"Common Lisp: A Gentle Introduction to Symbolic Computation"
Benjamin/Cummings Publishers, Redwood City, CA, 1990. 592 pages.
ISBN 0-8053-0492-4 ($42.95).
Perhaps the best tutorial introduction to the language. It has
clear and correct explanations, and covers some fairly advanced
topics. The book is an updated Common Lisp version of the 1 Source: CoolInterview.com
Question: What is a "Lisp Machine" (LISPM)?
Answer: A Lisp machine (or LISPM) is a computer which has been optimized to run lisp
efficiently and provide a good environment for programming in it. The
original Lisp machines were implemented at MIT, with spinoffs as LMI (defunct)
and Symbolics (bankrupt). Xerox also had a series of Lisp machines
(Dandylion, Dandytiger), as did Texas Instruments (TI Explorer). The
TI and Symbolics Lisp machines are currently available as cards that
fit into Macintosh computers (the so-called "Lisp o Source: CoolInterview.com
Question: How do I tell LG3 what I what?
Answer: By selecting general operations from the tools menu. You can think of the tools as building blocks - each tool corresponding to several lines of LISP code. The tools you use and the order in which you select them defines what your program does. Source: CoolInterview.com
Question: Can I call Lisp functions from other languages?
Answer: In implementations that provide a foreign function interface as described
above, there is also usually a "callback" mechanism. The programmer may
associate a foreign language function name with a Lisp function. When a
foreign object file or library is loaded into the Lisp address space, it is
linked with these callback functions. As with foreign functions, the
programmer must supply the argument and result data types so that Lisp may
perform conversions at the interface. Not Source: CoolInterview.com
Question: How do I save an executable image of my loaded Lisp system? How do I run a Unix command in my Lisp? How do I exit Lisp? Access environment variables?
Answer: There is no standard for dumping a Lisp image. Here are the
commands from some lisp implementations:
Symbolics: Save World [CP command]
CMU CL: SAVE-LISP
Franz Allegro: EXCL:DUMPLISP (documented)
Medley: IL:SYSOUT or IL:MAKESYS
MCL: SAVE-APPLICATION <pathname>
&key :toplevel-functio Source: CoolInterview.com
Question: Where can I learn about implementing Lisp interpreters and compilers?
Answer: Books about Lisp implementation include:
1. John Allen
"Anatomy of Lisp"
McGraw-Hill, 1978. 446 pages. ISBN 0-07-001115-X
Discusses some of the fundamental issues involved in
the implemention of Lisp.
2. Samuel Kamin
"Programming Languages, An Interpreter-Based Approach"
Addison-Wesley, Reading, Mass., 1990. ISBN 0-201-06824-9
Includes sources to several interpreters for Lisp-like languages.
Question: Can I save my programs to files?
Answer: Yes, absolutely, and the files are standard LISP code that will run on any AutoCAD system. Source: CoolInterview.com
India News Network
Latest 20 Questions
Payment of time- barred debt is:
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal