Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1622123.1622137acmotherconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Simple and efficient compilation of list comprehension in common Lisp

Published: 01 April 2007 Publication History

Abstract

List Comprehension is a succinct syntactic form to describe lists in functional languages. It uses nested generators (i.e., iterators) and filters (i.e., Boolean expressions). The former generates lists, whereas the latter restricts the contents of these lists. List Comprehension translation is commonly based on Wadler's rules that emit code based on recursive functions. This code often results either in stack overflow or in inefficient execution for many Common Lisp implementations.
We present a very simple technique to compile List Comprehension in the Loop Facility of Common Lisp, resulting in efficient code that avoids stack overflow. Our translation code is also very short, with an emitted code very close to the user-specified list comprehension.
We also present a translation into more fundamental constructs of Common Lisp that often results in even more efficient code, although this translation is more complex than using the Loop Facility.
The author has used the first translation technique for compiling a new language called Bio Velo, which is part of bioinformatics software called Pathway Tools [2].

References

[1]
Guy L. Steele Jr. Common Lisp, The Language, Second Edition. Digital Press, 1990.
[2]
Peter D. Karp, Suzanne Paley, and Pedro Romero. The Pathway Tools software. Bioinformatics, 18(S):225--32, 2002.
[3]
Guy Lapalme. Implementation of a "Lisp comprehension" macro. SIGPLAN Lisp Pointers, IV(2):16--23, 1991.
[4]
Simon L. Peyton-Jones. The Implementation of Functional Languages. Prentice-Hall, 1987.
[5]
Sven-Olof Nyström. Generalized comprehensions for Common Lisp. http://user.it.uu.se/~svenolof/Collect, 2007.

Cited By

View all
  • (2008)Database Management System for Protein Structure DataInnovations and Advanced Techniques in Systems, Computing Sciences and Software Engineering10.1007/978-1-4020-8735-6_98(526-531)Online publication date: 2008

Index Terms

  1. Simple and efficient compilation of list comprehension in common Lisp

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      ILC '07: Proceedings of the 2007 International Lisp Conference
      April 2007
      187 pages
      ISBN:9781595936189
      DOI:10.1145/1622123
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Sponsors

      • Association of Lisp Users

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 01 April 2007

      Permissions

      Request permissions for this article.

      Check for updates

      Qualifiers

      • Research-article

      Conference

      ILC07
      Sponsor:
      ILC07: 2007 International Lisp Conference
      April 1 - 4, 2007
      Cambridge, United Kingdom

      Acceptance Rates

      Overall Acceptance Rate 18 of 26 submissions, 69%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)7
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 15 Oct 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2008)Database Management System for Protein Structure DataInnovations and Advanced Techniques in Systems, Computing Sciences and Software Engineering10.1007/978-1-4020-8735-6_98(526-531)Online publication date: 2008

      View Options

      Get Access

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media