您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 广告经营 > Basic Lisp Techniques
BasicLispTechniquesDavidJ.Cooper,Jr.October10,2000ii0Copyrightc2000,FranzInc.andDavidJ.Cooper,Jr.Foreword1Computers,andthesoftwareapplicationsthatpowerthem,permeateeveryfacetofourdailylives.Fromgroceriestoairlinereservationstodentalappointments,ourrelianceontechnologyisall-encompassing.And,wewantmore.Everyday,ourexpectationsoftechnologyandsoftwareincrease:smallercellphonesthatsurfthenetbettersearchenginesthatgenerateinformationweactuallywantvoice-activatedlaptopscarsthatknowexactlywheretogoThelistisendless.Unfortunately,thereisnotanendlesssupplyofprogrammersanddeveloperstosatisfyourinsatiableappetitesfornewfeaturesandgadgets.\Cheaptalenttohelpcompletethe\gruntworkofanapplicationnolongerexists.Further,thedaysofunlimitedfundingareover.Investorswanttoseeresults,fast.Everyday,hundredsofmagazineandon-linearticlesfocusonthetimeandpeopleresourcesneededtosupportfuturetechnologicalexpectations.CommonLisp(CL)isoneofthefewlanguagesanddevelopmentoptionsthatcanmeetthesechallenges.Powerful,exible,changeableonthey|increasingly,CLisplayingaleadingroleinareaswithcomplexproblem-solvingdemands.Engineersintheeldsofbioinformatics,scheduling,datamining,documentmanagement,B2B,andE-commercehaveallturnedtoCLtocompletetheirapplicationsontimeandwithinbudget.ButCLisnolongerjustappropriateforthemostcomplexproblems.Applicationsofmodestcomplexity,butwithdemandingneedsforfastdevelopmentcyclesandcustomization,arealsoidealcandidatesforCL.OtherlanguageshavetriedtomimicCL,withlimitedsuccess.Perl,Python,Java,C++,C#|theyallincorporatesomeofthefeaturesthatgiveLispitspower,buttheirimplementationstendtobebrittle.ThepurposeofthisbookistoshowcasethefeaturesthatmakeCLsomuchbetterthantheseimitators,andtogiveyoua\quick-startguideforusingCommonLispasadevelopmentenvironment.IfyouareanexperiencedprogrammerinlanguagesotherthanLisp,thisguidegivesyouallthetoolsyouneedtobeginwritingLispapplications.Ifyou'vehadsomeexposuretoLispinthepast,thisguidewillhelprefreshthosememoriesandshedsomenewlightonCLforyou.1thisForewordwasauthoredbyFranzInc.iiiivButbecareful,Lispcanbeaddicting!ThisiswhymanyFortune500companieswillusenothingelseontheir24/7,cutting-edge,mission-criticalapplications.Afterreadingthisbook,tryingoursoftware,andexperiencinga3to10timesincreaseinproductivity,webelieveyouwillfeelthesameway.Contents1Introduction11.1ThePast,Present,andFutureofCommonLisp................11.1.1LispYesterday..............................11.1.2LispToday................................11.1.3LispTomorrow..............................21.2ConvergenceofHardwareandSoftware....................31.3TheCLModelofComputation.........................32OperatingaCLDevelopmentEnvironment52.1InstallingaCLEnvironment..........................52.2RunningCLinaShellWindow.........................62.2.1StartingCLfromaTerminalWindow.................62.2.2StoppingCLfromaTerminalWindow.................62.3RunningCLinsideaTextEditor........................82.3.1ANoteonEmacsandTextEditors...................82.3.2EmacsTerminology...........................82.3.3Starting,Stopping,andWorkingWithCLinsideanEmacsShell..92.4RunningCLasasubprocessofEmacs.....................102.4.1StartingtheCLsubprocesswithinEmacs...............102.4.2WorkingwithCLasanEmacssubprocess...............112.4.3CompilingandLoadingaFilefromanEmacsbuer.........122.5IntegratedDevelopmentEnvironment.....................132.6TheUserInitFile................................132.7UsingCLasascriptinglanguage........................142.8DebugginginCL.................................152.8.1Commondebuggercommands......................152.8.2InterpretedvsCompiledCode.....................162.8.3Useof(break)andC-ctointerrupt...................162.8.4Proling..................................172.9DevelopingProgramsandApplicationsinCL.................172.9.1ALayeredApproach...........................172.9.2CompilingandLoadingyourProject..................172.9.3CreatinganApplication\FaslFile..................182.9.4CreatinganImageFile.........................19vviCONTENTS2.9.5BuildingRuntimeImages........................192.9.6UsinganApplicationInitFile......................192.10UsingCLwithOtherLanguagesandEnvironments..............202.10.1InterfacingwiththeOperatingSystem.................202.10.2ForeignFunctionInterface........................202.10.3InterfacingwithCorba..........................212.10.4CustomSocketConnections.......................212.10.5InterfacingwithWindows(COM,DLL,DDE)............212.10.6CodeGenerationintoOtherLanguages................233TheCLLanguage253.1OverviewofCLanditsSyntax.........................253.1.1EvaluationofArgumentstoaFunction................273.1.2LispSyntaxSimplicity..........................273.1.3TurningOEvaluation.........................283.1.4FundamentalCLDataTypes......................293.1.5Functions.................................313.1.6GlobalandLocalVariables.......................323.2TheListasaDataStructure..........................343.2.1AccessingtheElementsofaList....................353.2.2Th
本文标题:Basic Lisp Techniques
链接地址:https://www.777doc.com/doc-4282435 .html