Conference paper Open Access

Writing a best-effort portable code walker in Common Lisp

Raskin Mikhail


DCAT Export

<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:duv="http://www.w3.org/ns/duv#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:frapo="http://purl.org/cerif/frapo/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gsp="http://www.opengis.net/ont/geosparql#" xmlns:locn="http://www.w3.org/ns/locn#" xmlns:org="http://www.w3.org/ns/org#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:wdrs="http://www.w3.org/2007/05/powder-s#">
  <rdf:Description rdf:about="https://doi.org/10.5281/zenodo.3254669">
    <rdf:type rdf:resource="http://www.w3.org/ns/dcat#Dataset"/>
    <dct:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
    <dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://doi.org/10.5281/zenodo.3254669</dct:identifier>
    <foaf:page rdf:resource="https://doi.org/10.5281/zenodo.3254669"/>
    <dct:creator>
      <rdf:Description rdf:about="http://orcid.org/0000-0002-6660-5673">
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0000-0002-6660-5673</dct:identifier>
        <foaf:name>Raskin Mikhail</foaf:name>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>LaBRI, University of Bordeaux</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:title>Writing a best-effort portable code walker in Common Lisp</dct:title>
    <dct:publisher>
      <foaf:Agent>
        <foaf:name>Zenodo</foaf:name>
      </foaf:Agent>
    </dct:publisher>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">2017</dct:issued>
    <dcat:keyword>code walker</dcat:keyword>
    <dcat:keyword>macro expansion</dcat:keyword>
    <dcat:keyword>code transformation</dcat:keyword>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-04-04</dct:issued>
    <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/ENG"/>
    <owl:sameAs rdf:resource="https://zenodo.org/record/3254669"/>
    <adms:identifier>
      <adms:Identifier>
        <skos:notation rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://zenodo.org/record/3254669</skos:notation>
        <adms:schemeAgency>url</adms:schemeAgency>
      </adms:Identifier>
    </adms:identifier>
    <dct:isVersionOf rdf:resource="https://doi.org/10.5281/zenodo.3254668"/>
    <dct:isPartOf rdf:resource="https://zenodo.org/communities/els"/>
    <dct:description>&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;</dct:description>
    <dct:accessRights rdf:resource="http://publications.europa.eu/resource/authority/access-right/PUBLIC"/>
    <dct:accessRights>
      <dct:RightsStatement rdf:about="info:eu-repo/semantics/openAccess">
        <rdfs:label>Open Access</rdfs:label>
      </dct:RightsStatement>
    </dct:accessRights>
    <dcat:distribution>
      <dcat:Distribution>
        <dct:license rdf:resource="https://creativecommons.org/licenses/by-sa/4.0/legalcode"/>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3254669"/>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL>https://doi.org/10.5281/zenodo.3254669</dcat:accessURL>
        <dcat:byteSize>296586</dcat:byteSize>
        <dcat:downloadURL>https://zenodo.org/record/3254669/files/writing-portable-macroexpand-all.pdf</dcat:downloadURL>
        <dcat:mediaType>application/pdf</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
  </rdf:Description>
</rdf:RDF>
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