{"title":"On listing list prefixes","authors":"O. Danvy","doi":"10.1145/1317258.1317263","DOIUrl":null,"url":null,"abstract":"The Lisp Puzzles feature in Lisp Pointers, Volume 1, Number 6 proposed the following exercise: given a list, compute the list of its prefixes. Surprisingly, the solutions proposed in later issues all used intermediary copies and/or traversed the original list repeatedly. This note presents a higher-order solution that does not use copies and that traverses the original list only once. Further, this solution can be simply expressed by abstracting control procedurally.","PeriodicalId":262740,"journal":{"name":"ACM SIGPLAN Lisp Pointers","volume":"65 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Lisp Pointers","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1317258.1317263","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9
Abstract
The Lisp Puzzles feature in Lisp Pointers, Volume 1, Number 6 proposed the following exercise: given a list, compute the list of its prefixes. Surprisingly, the solutions proposed in later issues all used intermediary copies and/or traversed the original list repeatedly. This note presents a higher-order solution that does not use copies and that traverses the original list only once. Further, this solution can be simply expressed by abstracting control procedurally.