Conference paper Open Access

Writing a best-effort portable code walker in Common Lisp

Raskin Mikhail


JSON-LD (schema.org) Export

{
  "inLanguage": {
    "alternateName": "eng", 
    "@type": "Language", 
    "name": "English"
  }, 
  "description": "<p>One of the powerful features of the Lisp language family is possibility to extend the language using macros.&nbsp; Some of possible extensions would benefit from a code walker, i.e. a library for processing code that keeps track of the status of different part of code, for their implementation.&nbsp; But in practice code walking is generally avoided.&nbsp;<br>\n<br>\nIn this paper, we study facilities useful to code walkers provided by &lsquo;&lsquo;Common Lisp: the Language&rsquo;&rsquo; (2nd edition) and the Common Lisp standard.&nbsp; We will show that the features described in the standard are not sufficient to write a fully portable code walker.<br>\n<br>\nOne of the problems is related to a powerful but rarely discussed feature.&nbsp; The macrolet special form allows a macro function to pass information easily to other macro invocations inside the lexical scope of the expansion.<br>\n<br>\nAnother problem for code analysis is related to the usage of non-standard special forms in expansions of standard macros. We review the handling of defun by popular free software Common Lisp implementations.<br>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>\nWe also survey the abilities and limitations of the available code walking and recursive macro expansion libraries.&nbsp; Some examples of apparently-conforming code that exhibit avoidable limitations of the portable code walking tools are provided.<br>\n<br>\nWe present a new attempt to implement a portable best-effort code walker for Common Lisp called Agnostic Lizard.<br>\n&nbsp;</p>", 
  "license": "https://creativecommons.org/licenses/by-sa/4.0/legalcode", 
  "creator": [
    {
      "affiliation": "LaBRI, University of Bordeaux", 
      "@id": "https://orcid.org/0000-0002-6660-5673", 
      "@type": "Person", 
      "name": "Raskin Mikhail"
    }
  ], 
  "headline": "Writing a best-effort portable code walker in Common Lisp", 
  "image": "https://zenodo.org/static/img/logos/zenodo-gradient-round.svg", 
  "datePublished": "2017-04-04", 
  "url": "https://zenodo.org/record/3254669", 
  "@type": "ScholarlyArticle", 
  "keywords": [
    "code walker", 
    "macro expansion", 
    "code transformation"
  ], 
  "@context": "https://schema.org/", 
  "identifier": "https://doi.org/10.5281/zenodo.3254669", 
  "@id": "https://doi.org/10.5281/zenodo.3254669", 
  "workFeatured": {
    "url": "https://european-lisp-symposium.org/2017/", 
    "alternateName": "ELS-2017", 
    "location": "Brussels, Belgium", 
    "@type": "Event", 
    "name": "European Lisp Symposum 2017"
  }, 
  "name": "Writing a best-effort portable code walker in Common Lisp"
}
244
227
views
downloads
All versions This version
Views 244244
Downloads 227227
Data volume 67.3 MB67.3 MB
Unique views 230230
Unique downloads 204204

Share

Cite as