emacs.d/clones/lisp/www.cliki.net/Issue DEFINE-COMPILER-MACRO-DECLINE.html

94 lines
5.7 KiB
HTML
Raw Normal View History

2022-10-07 15:47:14 +02:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: Issue DEFINE-COMPILER-MACRO-DECLINE</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=Issue%20DEFINE-COMPILER-MACRO-DECLINE">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - Issue DEFINE-COMPILER-MACRO-DECLINE</span>
<div id="content"><div id="content-area"><div id="article-title">Issue DEFINE-COMPILER-MACRO-DECLINE</div><div id="article"><a href="Issue.html" class="category">Issue</a>: DEFINE-COMPILER-MACRO-DECLINE<p>Forum: Editorial<p>References: <a href="https://www.cliki.net/site/HyperSpec/Body/mac_define-compiler-macro.html" class="hyperspec">DEFINE-COMPILER-MACRO</a><p>Category: CLARIFICATION/CHANGE<p>Edit history: 2004-06-16, Version 1 by Christophe Rhodes<p>Status: For <a href="CLiki.html" class="internal">CLiki</a> consideration<p><dl>
<dt>Problem Description:
</dt>
<dd>
The glossary entry for <a href="http://www.lispworks.com/reference/HyperSpec/Body/26_glo_c.htm#compiler_macro_function">compiler macro function</a> is inconsistent with the entries in the main body of the standard: the glossary states that returning <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="hyperspec">nil</a> from the compiler macro function indicates that the original form should not be expanded, whereas <a href="https://www.cliki.net/site/HyperSpec/Body/mac_define-compiler-macro.html" class="hyperspec">define-compiler-macro</a> states that this is achieved by returning the original form (from the <a href="https://www.cliki.net/site/HyperSpec/Body/sec_3-4-4.html" class="hyperspec">&amp;whole</a> argument).<p></dd>
<dt>Proposal (DEFINE-COMPILER-MACRO-DECLINE:ORIGINAL-FORM-ONLY):
</dt>
<dd>
Specify that the glossary entry was in error, and that to decline expansion the original form should be returned from the compiler macro function. Specify that a return value of <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="hyperspec">nil</a> indicates that the form should be expanded by the compiler, if it expands the compiler macro at all, to <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="hyperspec">nil</a>.<p></dd>
<dt>Test case:
</dt>
<dd><p></dd>
<dt>Rationale:
</dt>
<dd>
The glossary entry was clearly in error, and could potentially cause confusion.<p></dd>
<dt>Current practice:
</dt>
<dd>
<a href="SBCL.html" class="internal">SBCL</a> 0.8.11 (and earlier versions), <a href="CMUCL.html" class="internal">CMUCL</a> 18e and <a href="CLISP.html" class="internal">CLISP</a> 2.33 behave as in proposal DEFINE-COMPILER-MACRO-DECLINE:ORIGINAL-FORM-ONLY.<p></dd>
<dt>Cost to Implementors:
</dt>
<dd>
Minimal.<p></dd>
<dt>Cost to Users:
</dt>
<dd>
None.<p></dd>
<dt>Cost of Non-Adoption:
</dt>
<dd>
Continued confusion over the required semantics of a compiler macro function.<p></dd>
<dt>Benefits:
</dt>
<dd>
Enhanced ability to write compiler macros portably.<p></dd>
<dt>Aesthetics:
</dt>
<dd>
Returning the original form to decline is clearly superior to returning <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="hyperspec">nil</a>, as it avoids any possible confusion over <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="hyperspec">nil</a> as expansion.<p></dd>
<dt>Discussion:
</dt>
<dd><p></dd>
</dl></div></div>
<div id="footer" class="buttonbar"><ul><li><a href="Issue&#32;DEFINE-COMPILER-MACRO-DECLINE.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=Issue%20DEFINE-COMPILER-MACRO-DECLINE">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=Issue%20DEFINE-COMPILER-MACRO-DECLINE">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=Issue%20DEFINE-COMPILER-MACRO-DECLINE&amp;from-revision=3805926780">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>