Conference paper Open Access

Writing a best-effort portable code walker in Common Lisp

Raskin Mikhail


DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
  <identifier identifierType="DOI">10.5281/zenodo.3254669</identifier>
  <creators>
    <creator>
      <creatorName>Raskin Mikhail</creatorName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0002-6660-5673</nameIdentifier>
      <affiliation>LaBRI, University of Bordeaux</affiliation>
    </creator>
  </creators>
  <titles>
    <title>Writing a best-effort portable code walker in Common Lisp</title>
  </titles>
  <publisher>Zenodo</publisher>
  <publicationYear>2017</publicationYear>
  <subjects>
    <subject>code walker</subject>
    <subject>macro expansion</subject>
    <subject>code transformation</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2017-04-04</date>
  </dates>
  <language>en</language>
  <resourceType resourceTypeGeneral="Text">Conference paper</resourceType>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/3254669</alternateIdentifier>
  </alternateIdentifiers>
  <relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.3254668</relatedIdentifier>
    <relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://zenodo.org/communities/els</relatedIdentifier>
  </relatedIdentifiers>
  <rightsList>
    <rights rightsURI="https://creativecommons.org/licenses/by-sa/4.0/legalcode">Creative Commons Attribution Share Alike 4.0 International</rights>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
  </rightsList>
  <descriptions>
    <description descriptionType="Abstract">&lt;p&gt;One of the powerful features of the Lisp language family is possibility to extend the language using macros.&amp;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.&amp;nbsp; But in practice code walking is generally avoided.&amp;nbsp;&lt;br&gt;
&lt;br&gt;
In this paper, we study facilities useful to code walkers provided by &amp;lsquo;&amp;lsquo;Common Lisp: the Language&amp;rsquo;&amp;rsquo; (2nd edition) and the Common Lisp standard.&amp;nbsp; We will show that the features described in the standard are not sufficient to write a fully portable code walker.&lt;br&gt;
&lt;br&gt;
One of the problems is related to a powerful but rarely discussed feature.&amp;nbsp; The macrolet special form allows a macro function to pass information easily to other macro invocations inside the lexical scope of the expansion.&lt;br&gt;
&lt;br&gt;
Another 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.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
We also survey the abilities and limitations of the available code walking and recursive macro expansion libraries.&amp;nbsp; Some examples of apparently-conforming code that exhibit avoidable limitations of the portable code walking tools are provided.&lt;br&gt;
&lt;br&gt;
We present a new attempt to implement a portable best-effort code walker for Common Lisp called Agnostic Lizard.&lt;br&gt;
&amp;nbsp;&lt;/p&gt;</description>
  </descriptions>
</resource>
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