Conference paper Open Access

Writing a best-effort portable code walker in Common Lisp

Raskin Mikhail


MARC21 XML Export

<?xml version='1.0' encoding='UTF-8'?>
<record xmlns="http://www.loc.gov/MARC21/slim">
  <leader>00000nam##2200000uu#4500</leader>
  <datafield tag="041" ind1=" " ind2=" ">
    <subfield code="a">eng</subfield>
  </datafield>
  <datafield tag="653" ind1=" " ind2=" ">
    <subfield code="a">code walker</subfield>
  </datafield>
  <datafield tag="653" ind1=" " ind2=" ">
    <subfield code="a">macro expansion</subfield>
  </datafield>
  <datafield tag="653" ind1=" " ind2=" ">
    <subfield code="a">code transformation</subfield>
  </datafield>
  <controlfield tag="005">20200120173505.0</controlfield>
  <controlfield tag="001">3254669</controlfield>
  <datafield tag="711" ind1=" " ind2=" ">
    <subfield code="d">3-4 April 2017</subfield>
    <subfield code="g">ELS-2017</subfield>
    <subfield code="a">European Lisp Symposum 2017</subfield>
    <subfield code="c">Brussels, Belgium</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">296586</subfield>
    <subfield code="z">md5:157e8df3fbae027251bb0462e105e12c</subfield>
    <subfield code="u">https://zenodo.org/record/3254669/files/writing-portable-macroexpand-all.pdf</subfield>
  </datafield>
  <datafield tag="542" ind1=" " ind2=" ">
    <subfield code="l">open</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="y">Conference website</subfield>
    <subfield code="u">https://european-lisp-symposium.org/2017/</subfield>
  </datafield>
  <datafield tag="260" ind1=" " ind2=" ">
    <subfield code="c">2017-04-04</subfield>
  </datafield>
  <datafield tag="909" ind1="C" ind2="O">
    <subfield code="p">openaire</subfield>
    <subfield code="p">user-els</subfield>
    <subfield code="o">oai:zenodo.org:3254669</subfield>
  </datafield>
  <datafield tag="100" ind1=" " ind2=" ">
    <subfield code="u">LaBRI, University of Bordeaux</subfield>
    <subfield code="0">(orcid)0000-0002-6660-5673</subfield>
    <subfield code="a">Raskin Mikhail</subfield>
  </datafield>
  <datafield tag="245" ind1=" " ind2=" ">
    <subfield code="a">Writing a best-effort portable code walker in Common Lisp</subfield>
  </datafield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">user-els</subfield>
  </datafield>
  <datafield tag="540" ind1=" " ind2=" ">
    <subfield code="u">https://creativecommons.org/licenses/by-sa/4.0/legalcode</subfield>
    <subfield code="a">Creative Commons Attribution Share Alike 4.0 International</subfield>
  </datafield>
  <datafield tag="650" ind1="1" ind2="7">
    <subfield code="a">cc-by</subfield>
    <subfield code="2">opendefinition.org</subfield>
  </datafield>
  <datafield tag="520" ind1=" " ind2=" ">
    <subfield code="a">&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;</subfield>
  </datafield>
  <datafield tag="773" ind1=" " ind2=" ">
    <subfield code="n">doi</subfield>
    <subfield code="i">isVersionOf</subfield>
    <subfield code="a">10.5281/zenodo.3254668</subfield>
  </datafield>
  <datafield tag="024" ind1=" " ind2=" ">
    <subfield code="a">10.5281/zenodo.3254669</subfield>
    <subfield code="2">doi</subfield>
  </datafield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">publication</subfield>
    <subfield code="b">conferencepaper</subfield>
  </datafield>
</record>
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