File:CedarExamples.doclookforEDITPOINTLasteditedbyMItchell,May31,19822:04pmTODOputalltheexamplesinasingleDFfilesothatuserscangetthemandexecutethem.linenumber,figure,etc.gensyms:notethatthoseinthetextoftheformeval.note.5refertothenotesfollowingtheevalexample,whileeval.5referstoalineintheprogram.Areferenceisoftheformeval.note.note.5!oreval.note.7!whilethedefinitionofthenoteorlineisgivenaseval.note.note.5@oreval.note.7@,respectively.rgc@--rgc.23sort@--sort.10eval@--eval.8tool@--tool.0SampleCedar3ProgramsThissectioncontainsasetoffourexamplesofCedarprogramsforyourreadingpleasure.Theseareactualprogramsthatcanberun,usedaspartsofotherprograms,ortreatedastemplatestobeeditedintonewprogramswithsimilarstructures.Foreachexamplethereisashortdiscussionofitspurposefollowedbytheprogramitself,afterwhichthereisasetofnotestohelpinreadingtheexample.Thenotesarekeyedtotheprogramsbythenumbersinparenthesestotherightofsomelines,e.g.,as"--(note5)".Youshouldreadtheexamplesforunderstandingandusethenotesasreferences,nottheotherwayround.Theintentionofthenotesistoaidthereader,nottodescribeeachsyntacticorsemanticnuanceoftheexample.IfyouhavenotyetreadtheCedar3LanguageOverview,youshoulddosobeforereadingthissection.rgc.1Example1:asimple,butcompleteprogramThisfirstexampleshowshowtowriteasimpleCedarprogram.Thoughsimple,theprogramillustratesanumberoffeaturesoftheCedarlanguageandsystemaswellassomeofthestylisticconventionsusedbyCedarprogrammers(seesection<