/
index.html
256 lines (208 loc) · 10.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="canonical" href="https://www.hexstreamsoft.com/libraries/macro-level/" />
<meta name="author" content="Jean-Philippe Paradis" />
<link rel="author" href="https://abc.hexstream.xyz/" />
<link rel="license" href="https://www.hexstreamsoft.com/UNLICENSE" />
<meta name="description" content="(macro-level ...) == (macrolet ((m () ...)) (m)). Saves on indentation while being more concise and direct." />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>macro-level | Libraries | HexstreamSoft</title>
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/global.css" />
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/section-nav.css" />
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/tabs.css" />
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/tags.css" />
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/cl.css" />
<link rel="stylesheet" type="text/css" href="https://global.hexstream.dev/css/cl-definitions.css" />
<link rel="stylesheet" type="text/css" href="https://www.hexstreamsoft.com/libraries/libraries.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="preload" as="font" type="font/woff2" href="https://global.hexstream.dev/fonts/kaushan-script/KaushanScript-Regular.woff2" crossorigin />
<link rel="preload" as="font" type="font/woff2" href="https://global.hexstream.dev/fonts/liberation/LiberationSerif-Regular.woff2" crossorigin />
<link rel="preload" as="image" type="image/svg+xml" href="https://global.hexstream.dev/non-free/images/logos/github.svg" />
<link rel="preload" as="image" type="image/svg+xml" href="https://global.hexstream.dev/images/logos/public-domain.svg" />
<link rel="preload" as="image" type="image/svg+xml" href="https://global.hexstream.dev/non-free/images/logos/quicklisp.svg" />
<script src="https://global.hexstream.dev/scripts/arrows-madness.mjs" type="module"></script>
<script src="https://www.hexstreamsoft.com/libraries/libraries.mjs" type="module"></script>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@HexstreamSoft" />
<meta name="twitter:title" content="macro-level" />
<meta name="twitter:description" content="An embarassingly trivial convenience macro that saves on indentation while being more concise and direct. (macro-level ...) == (macrolet ((m () ...)) (m))" />
</head>
<body>
<nav id="top-nav">
<div class="main">
<div class="breadcrumbs">
<a href="https://www.hexstreamsoft.com/">HexstreamSoft</a>
<span class="crumb"><span class="s"> » </span><a href="https://www.hexstreamsoft.com/libraries/">Libraries</a></span>
<span class="crumb"><span class="s"> » </span><a class="here">macro-level</a></span>
</div>
<nav class="tabs" id="meta-nav">
<ul>
<li><a class="github" href="https://github.com/Hexstream/macro-level"><span>See on GitHub</span></a></li>
</ul>
</nav>
</div>
<p id="last-updated"><span>This page was last updated on </span><time datetime="2023-10-06">6 october 2023</time><span>.</span></p>
</nav>
<main>
<header id="page-header">
<h1>macro-level</h1>
</header>
<div class="tags contains-groups">
<div class="group prominent">
<span class="tag hv license">
<span class="h">License<span>:</span></span>
<span class="v">Public Domain</span>
</span>
<span class="s">, </span>
<span class="tag hv quicklisp">
<span class="h">Load it with Quicklisp<span>:</span></span>
<code class="v">(ql:quickload "macro-level")</code>
</span>
</div>
<div class="group">
<span class="tag hv">
<span class="h">Library type<span>:</span></span>
<span class="v">Visual macro</span>
</span>
<span class="s">, </span>
<span class="tag hv">
<span class="h">Project complexity<span>:</span></span>
<span class="v">Embarrassingly trivial</span>
</span>
</div>
</div>
<nav class="tabs" id="further-info">
<ul>
<li><a href="https://www.hexstreamsoft.com/libraries/releases/latest-versions/#macro-level">Latest release</a></li>
<li><a href="https://www.hexstreamsoft.com/libraries/dependencies/#macro-level">Dependencies</a></li>
</ul>
<ul>
<li><a href="https://www.hexstreamsoft.com/libraries/external-pages-xref/#macro-level">External library pages</a></li>
</ul>
</nav>
<section id="introduction">
<p>
<dfn><code class="relevant">macro-level</code></dfn> is an embarrassingly trivial convenience macro
<br />
that saves on indentation while being more concise and direct.
</p>
<div class="scroll">
<pre class="example"><code class="common-lisp">(<code class="relevant">macro-level</code>
...)
==
<span class="comment">;; Canonical indentation. <code class="relevant">macro-level</code> saves <span class="saved-indentation">11 spaces</span>.</span>
(macrolet ((<var>m</var> ()
<span class="saved-indentation"> </span>...))
(<var>m</var>))
==
<span class="comment">;; "Miser" indentation. <code class="relevant">macro-level</code> saves <span class="saved-indentation">5 spaces</span>.</span>
(macrolet
((<var>m</var> ()
<span class="saved-indentation"> </span>...))
(<var>m</var>))</code></pre>
</div>
</section>
<nav class="tabs">
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#dictionary">Dictionary</a></li>
</ul>
<ul>
<li><a href="#future-work">Future work</a></li>
</ul>
</nav>
<section id="overview">
<h1 class="breadcrumbs-bar">
<span class="section-relative-nav">
<a href="#overview" class="anchor">⚓</a>
</span>
<span class="breadcrumbs">
<a class="here">Overview</a>
</span>
</h1>
<p>When used as part of a macroexpansion, <code class="relevant">macro-level</code> also conveniently relieves the macro implementor from naming and using a <code>gensym</code> for the one-shot macro when compared to writing out a <code>macrolet</code> by hand, in addition to the other advantages.</p>
</section>
<section id="dictionary">
<h1 class="breadcrumbs-bar">
<span class="section-relative-nav">
<a href="#dictionary" class="anchor">⚓</a>
</span>
<span class="breadcrumbs">
<a class="here">Dictionary</a>
</span>
</h1>
<nav class="tabs">
<ul>
<li><a href="#dictionary_macro-level"><span class="type">Package</span> <code>macro-level</code></a></li>
<li><a href="#dictionary_macro-level"><span class="type">Macro</span> <code>macro-level</code></a></li>
</ul>
</nav>
<section id="dictionary_macro-level">
<h1 class="breadcrumbs-bar">
<span class="section-relative-nav">
<a href="#dictionary_macro-level" class="anchor">⚓</a>
</span>
<span class="breadcrumbs">
<a href="#dictionary">Dictionary</a>
<span class="crumb"><span class="s"> » </span><a class="here">macro-level</a></span>
</span>
</h1>
<article class="package definition">
<h1><span class="type">Package</span> <span class="name self">macro-level</span></h1>
<section class="description">
<h1>Description</h1>
<p>Simply <code>(:import-from #:macro-level #:<code class="relevant"><a href="#dictionary_macro-level">macro-level</a></code>)</code> from your <a href="http://www.lispworks.com/documentation/HyperSpec/Body/m_defpkg.htm" target="_blank">defpackage</a>. Don't <code>(:use)</code>!</p>
</section>
</article>
<article class="macro definition">
<h1><span class="type">Macro</span> <span class="name self">macro-level</span></h1>
<p class="args-and-retvals">&body <var>body</var> => <var>results</var></p>
<section class="arguments-and-values">
<h1>Arguments and Values</h1>
<ul>
<li><var>body</var> -- An <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_i.htm#implicit_progn" target="_blank">implicit progn</a>.</li>
<li><var>results</var> -- The values of <var>body</var>.</li>
</ul>
</section>
<section class="description">
<h1>Description</h1>
<p>Expands to <code>`(macrolet ((,<var>macro</var> () ,@<var>body</var>)) (,<var>macro</var>))</code> where <var>macro</var> is a gensym.</p>
</section>
</article>
</section>
<nav class="end-of-section-indicator">
<a href="#dictionary">
"<span>Dictionary</span>" end.
</a>
</nav>
</section>
<section id="future-work">
<h1 class="breadcrumbs-bar">
<span class="section-relative-nav">
<a href="#future-work" class="anchor">⚓</a>
</span>
<span class="breadcrumbs">
<a class="here">Future work</a>
</span>
</h1>
<p>Support could eventually be added to <a href="https://common-lisp.net/project/slime/" target="_blank">Slime</a> so that interactive macroexpansion of <code class="relevant">macro-level</code> calls with <kbd>C-c C-m</kbd> (<code>slime-expand-1</code>)<br />would show the same expansion as interactively macroexpanding <code>(m ...)</code> after <code class="common-lisp">(defmacro m () ...)</code>, assuming the lexical context is not important.</p>
</section>
</main>
<footer id="footer">
<div class="back-to-top left">
<a href="#">⬆</a>
</div>
<div class="main">
<a href="https://validator.w3.org/check?uri=http%3A%2F%2Fwww.hexstreamsoft.com%2Flibraries%2Fmacro-level%2F">✔ HTML5</a>
<a href="https://www.hexstreamsoft.com/README">✔ Public Domain</a>
<a href="https://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.hexstreamsoft.com%2Flibraries%2Fmacro-level%2F">✔ CSS3</a>
<a>✔ Mobile-friendly</a>
</div>
<div class="back-to-top right">
<a href="#">⬆</a>
</div>
</footer>
</body>
</html>