86 lines
No EOL
4.7 KiB
HTML
86 lines
No EOL
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>CLiki: Issue DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE</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%20DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE">
|
|
<link rel="stylesheet" href="static/css/style.css">
|
|
<link rel="stylesheet" href="static/css/colorize.css">
|
|
</head>
|
|
|
|
<body>
|
|
<span class="hidden">CLiki - Issue DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE</span>
|
|
<div id="content"><div id="content-area"><div id="article-title">Issue DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE</div><div id="article"><a href="Issue.html" class="category">Issue</a>: DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE<p>Forum: Editorial<p>References: <a href="https://www.cliki.net/site/HyperSpec/Body/fun_digit-char-p.html" class="hyperspec">DIGIT-CHAR-P</a><p>Category: CLARIFICATION/CHANGE<p>Edit history: 2017-01-28, Version 1 by Michal Herda<p>Status: For CLiki consideration<p><dl>
|
|
<dt>Problem Description:
|
|
</dt>
|
|
<dd>The output of DIGIT-CHAR-P might be confusing, as this function's return value also serves a different purpose. DIGIT-CHAR-P, aside from being a predicate, is also a converting function: it converts a digit in a given radix to its corresponding integer value.<p></dd>
|
|
<dt>Proposal (DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE:SPLIT):
|
|
</dt>
|
|
<dd>Rename DIGIT-CHAR-P to CHAR-DIGIT and possibly make it signal an error instead of returning NIL. Create a DIGIT-CHAR-P which returns either true or false.<p></dd>
|
|
<dt>Test case:
|
|
</dt>
|
|
<dd>(digit-char-p #\E 16) ;=> 14<p></dd>
|
|
<dt>Rationale:
|
|
</dt>
|
|
<dd>A predicate function should be a predicate and not additionally serve as a converting function.<p></dd>
|
|
<dt>Current practice:
|
|
</dt>
|
|
<dd>
|
|
<a href="https://www.cliki.net/site/HyperSpec/Body/fun_digit-char-p.html" class="hyperspec">DIGIT-CHAR-P</a> is used as a converting function<p></dd>
|
|
<dt>Cost to Implementors:
|
|
</dt>
|
|
<dd>Tiny.<p></dd>
|
|
<dt>Cost to Users:
|
|
</dt>
|
|
<dd>Incompatibility with previous uses of DIGIT-CHAR-P.<p></dd>
|
|
<dt>Cost of Non-Adoption:
|
|
</dt>
|
|
<dd>Confusion coming from the fact that <a href="https://www.cliki.net/site/HyperSpec/Body/fun_digit-char-p.html" class="hyperspec">DIGIT-CHAR-P</a> may be used in non-boolean contexts.<p></dd>
|
|
<dt>Benefits:
|
|
</dt>
|
|
<dd>Abiding to the single responsibility principle.<p></dd>
|
|
<dt>Aesthetics:<p><dt>Discussion:
|
|
<ul>
|
|
<li>Michał Herda supports DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE:SPLIT.
|
|
</li>
|
|
</ul><p></dt>
|
|
</dt>
|
|
</dl></div></div>
|
|
<div id="footer" class="buttonbar"><ul><li><a href="Issue DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE.html">Current version</a></li>
|
|
<li><a href="https://www.cliki.net/site/history?article=Issue%20DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE">History</a></li>
|
|
<li><a href="https://www.cliki.net/site/backlinks?article=Issue%20DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=Issue%20DIGIT-CHAR-P-NOT-AN-ACTUAL-PREDICATE&from-revision=3770932981">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 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> |