On listing list prefixes

  • Authors:
  • Olivier Danvy

  • Affiliations:
  • University of Copenhagen, Copenhagen Ø, Denmark

  • Venue:
  • ACM SIGPLAN Lisp Pointers
  • Year:
  • 1989
  • There and Back Again

    Fundamenta Informaticae - Program Transformation: Theoretical Foundations and Basic Techniques. Part 1

Quantified Score

Hi-index 0.00

Visualization

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.