1StructureandInterpretationofComputerProgramssecondeditionHaroldAbelsonandGeraldJaySussmanwithJulieSussmanforewordbyAlanJ.PerlisTheMITPressCambridge,MassachusettsLondon,EnglandMcGraw-HillBookCompanyNewYorkSt.LouisSanFranciscoMontrealToronto2ThisbookisoneofaseriesoftextswrittenbyfacultyoftheElectricalEngineeringandComputerScienceDepartmentattheMassachusettsInstituteofTechnology.ItwaseditedandproducedbyTheMITPressunderajointproduction-distributionarrangementwiththeMcGraw-HillBookCompany.OrderingInformation:NorthAmericaTextordersshouldbeaddressedtotheMcGraw-HillBookCompany.AllotherordersshouldbeaddressedtoTheMITPress.OutsideNorthAmericaAllordersshouldbeaddressedtoTheMITPressoritslocaldistributor.©1996byTheMassachusettsInstituteofTechnologySecondeditionAllrightsreserved.Nopartofthisbookmaybereproducedinanyformorbyanyelectronicormechanicalmeans(includingphotocopying,recording,orinformationstorageandretrieval)withoutpermissioninwritingfromthepublisher.ThisbookwassetbytheauthorsusingtheLATEXtypesettingsystemandwasprintedandboundintheUnitedStatesofAmerica.LibraryofCongressCataloging-in-PublicationDataAbelson,HaroldStructureandinterpretationofcomputerprograms/HaroldAbelsonandGeraldJaySussman,withJulieSussman.--2nded.p.cm.--(Electricalengineeringandcomputerscienceseries)Includesbibliographicalreferencesandindex.ISBN0-262-01153-0(MITPresshardcover)ISBN0-262-51087-1(MITPresspaperback)ISBN0-07-000484-6(McGraw-Hillhardcover)1.Electronicdigitalcomputers--Programming.2.LISP(Computerprogramlanguage)I.Sussman,GeraldJay.II.Sussman,Julie.III.Title.IV.Series:MITelectricalengineeringandcomputerscienceseries.QA76.6.A2551996005.13'3--dc2096-17756Fourthprinting,19993Thisbookisdedicated,inrespectandadmiration,tothespiritthatlivesinthecomputer.``Ithinkthatit'sextraordinarilyimportantthatweincomputersciencekeepfunincomputing.Whenitstartedout,itwasanawfullotoffun.Ofcourse,thepayingcustomersgotshaftedeverynowandthen,andafterawhilewebegantotaketheircomplaintsseriously.Webegantofeelasifwereall...