人工智能神经网络及其语言OnLisp-AdvancedTechniquesforCommonLisp.pdf
《人工智能神经网络及其语言OnLisp-AdvancedTechniquesforCommonLisp.pdf》由会员分享,可在线阅读,更多相关《人工智能神经网络及其语言OnLisp-AdvancedTechniquesforCommonLisp.pdf(422页珍藏版)》请在文库网上搜索。
1、PrefaceThis book is intended for anyone who wants to become a better Lisp programmer.It assumes some familiarity with Lisp, but not necessarily extensive programmingexperience. The first few chapters contain a fair amount of review. I hope thatthese sections will be interesting to more experienced L
2、isp programmers as well,because they present familiar subjects in a new light.Its difficult to convey the essence of a programming language in one sentence,but John Foderaro has come close:Lisp is a programmable programming language.There is more to Lisp than this, but the ability to bend Lisp to on
3、es will is alarge part of what distinguishes a Lisp expert from a novice. As well as writingtheir programs down toward the language, experienced Lisp programmers buildthe language up toward their programs. This book teaches how to program in thebottom-up style for which Lisp is inherently well-suite
4、d.Bottom-up DesignBottom-up design is becoming more important as software grows in complexity.Programs today may have to meet specifications which are extremely complex,or even open-ended. Under such circumstances, the traditional top-down methodsometimes breaks down. In its place there has evolved
5、a style of programmingvvi PREFACEquite different from what is currently taught in most computer science courses:a bottom-up style in which a program is written as a series of layers, each oneacting as a sort of programming language for the one above. X Windows and TEXare examples of programs written
6、 in this style.The theme of this book is twofold: that Lisp is a natural language for programswritten in the bottom-up style, and that the bottom-up style is a natural way towrite Lisp programs. On Lisp will thus be of interest to two classes of readers.For people interested in writing extensible pr
7、ograms, this book will show whatyou can do if you have the right language. For Lisp programmers, this book offersa practical explanation of how to use Lisp to its best advantage.The title is intended to stress the importance of bottom-up programming inLisp. Instead of just writing your program in Li
8、sp, you can write your ownlanguage on Lisp, and write your program in that.It is possible to write programs bottom-up in any language, but Lisp is themost natural vehicle for this style of programming. In Lisp, bottom-up design isnot a special technique reserved for unusually large or difficult prog
9、rams. Anysubstantial program will be written partly in this style. Lisp was meant from thestart to be an extensible language. The language itself is mostly a collection ofLisp functions, no different from the ones you define yourself. Whats more, Lispfunctions can be expressed as lists, which are Li
10、sp data structures. This meansyou can write Lisp functions which generate Lisp code.A good Lisp programmer must know how to take advantage of this possibility.The usual way to do so is by defining a kind of operator called a macro. Masteringmacros is one of the most important steps in moving from wr
11、iting correct Lispprograms to writing beautiful ones. Introductory Lisp books have room for nomore than a quick overview of macros: an explanation of what macros are,togetherwith a few examples which hint at the strange and wonderful things you can dowith them. Those strange and wonderful things wil
12、l receive special attention here.One of the aims of this book is to collect in one place all that people have till nowhad to learn from experience about macros.Understandably, introductory Lisp books do not emphasize the differencesbetween Lisp and other languages. They have to get their message acr
13、oss tostudents who have, for the most part, been schooled to think of programs in Pascalterms. It would only confuse matters to explain that, while defun looks like aprocedure definition, it is actually a program-writing program that generates codewhich builds a functional object and indexes it unde
14、r the symbol given as the firstargument.One of the purposes of this book is to explain what makes Lisp different fromother languages. When I began, I knew that, all other things being equal, I wouldmuch rather write programs in Lisp than in C or Pascal or Fortran. I knew also thatthis was not merely
15、 a question of taste. But I realized that if I was actually goingPREFACE viito claim that Lisp was in some ways a better language, I had better be prepared toexplain why.When someone asked Louis Armstrong what jazz was, he replied “If you haveto ask what jazz is, youll never know.” But he did answer
16、 the question in a way:he showed people what jazz was. Thats one way to explain the power of Lisptodemonstrate techniques that would be difficult or impossible in other languages.Most books on programmingeven books on Lisp programmingdeal with thekinds of programs you could write in any language. On
17、 Lisp deals mostly withthe kinds of programs you could only write in Lisp. Extensibility, bottom-upprogramming, interactive development, source code transformation, embeddedlanguagesthis is where Lisp shows to advantage.In principle, of course, any Turing-equivalent programming language can dothe sa
18、me things as any other. But that kind of power is not what programminglanguages are about. In principle, anything you can do with a programminglanguage you can do with a Turing machine; in practice, programming a Turingmachine is not worth the trouble.So when I say that this book is about how to do
19、things that are impossiblein other languages, I dont mean “impossible” in the mathematical sense, but inthe sense that matters for programming languages. That is, if you had to writesome of the programs in this book in C, you might as well do it by writing a Lispcompiler in C first. Embedding Prolog
20、 in C, for examplecan you imagine theamount of work that would take? Chapter 24 shows how to do it in 180 lines ofLisp.I hoped to do more than simply demonstrate the power of Lisp, though. I alsowanted to explain why Lisp is different. This turns out to be a subtle questiontoosubtle to be answered w
21、ith phrases like “symbolic computation.” What I havelearned so far, I have tried to explain as clearly as I can.Plan of the BookSince functions are the foundation of Lisp programs, the book begins with sev-eral chapters on functions. Chapter 2 explains what Lisp functions are and thepossibilities th
22、ey offer. Chapter 3 then discusses the advantages of functionalprogramming, the dominant style in Lisp programs. Chapter 4 shows how to usefunctions to extend Lisp. Then Chapter 5 suggests the new kinds of abstractionswe can define with functions that return other functions. Finally, Chapter 6 shows
23、how to use functions in place of traditional data structures.The remainder of the book deals more with macros than functions. Macrosreceive more attention partly because there is more to say about them, and partlybecause they have not till now been adequately described in print. Chapters 710viii PRE
24、FACEform a complete tutorial on macro technique. By the end of it you will know mostof what an experienced Lisp programmer knows about macros: how they work;how to define, test, and debug them; when to use macros and when not; the majortypes of macros; how to write programs which generate macro expa
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 人工智能 神经网络 及其 语言 OnLispAdvancedTechniquesforCommonLisp
链接地址:https://www.wenkunet.com/p-9845.html