<html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <link rel="stylesheet" href="../../coverage.css"/>  <title> beowulf/reader/macros.clj </title>
 </head>
 <body>
<span class="covered" title="1 out of 1 forms covered">
                001&nbsp;&nbsp;(ns&nbsp;beowulf.reader.macros
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                002&nbsp;&nbsp;&nbsp;&nbsp;&quot;Can&nbsp;I&nbsp;implement&nbsp;reader&nbsp;macros?&nbsp;let&#x27;s&nbsp;see!
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We&nbsp;don&#x27;t&nbsp;need&nbsp;(at&nbsp;least,&nbsp;in&nbsp;the&nbsp;Clojure&nbsp;reader)&nbsp;to&nbsp;rewrite&nbsp;forms&nbsp;like
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`&#x27;FOO`,&nbsp;because&nbsp;that&#x27;s&nbsp;handled&nbsp;by&nbsp;the&nbsp;parser.&nbsp;But&nbsp;we&nbsp;do&nbsp;need&nbsp;to&nbsp;rewrite
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;things&nbsp;which&nbsp;don&#x27;t&nbsp;evaluate&nbsp;their&nbsp;arguments,&nbsp;like&nbsp;`SETQ`,&nbsp;because&nbsp;(unless
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LABEL&nbsp;does&nbsp;it,&nbsp;which&nbsp;I&#x27;m&nbsp;not&nbsp;yet&nbsp;sure&nbsp;of)&nbsp;we&#x27;re&nbsp;not&nbsp;yet&nbsp;able&nbsp;to&nbsp;implement
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;things&nbsp;which&nbsp;don&#x27;t&nbsp;evaluate&nbsp;arguments.
                </span><br/>
<span class="blank" title="0 out of 0 forms covered">
                009&nbsp;&nbsp;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TODO:&nbsp;at&nbsp;this&nbsp;stage,&nbsp;the&nbsp;following&nbsp;should&nbsp;probably&nbsp;also&nbsp;be&nbsp;read&nbsp;macros:
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DEFINE&quot;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                012&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[beowulf.cons-cell&nbsp;:refer&nbsp;[make-beowulf-list]]
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[beowulf.host&nbsp;:refer&nbsp;[CONS&nbsp;LIST]]
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.string&nbsp;:refer&nbsp;[join]]))
                </span><br/>
<span class="blank" title="0 out of 0 forms covered">
                015&nbsp;&nbsp;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                016&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                017&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                018&nbsp;&nbsp;;;;&nbsp;We&nbsp;don&#x27;t&nbsp;need&nbsp;(at&nbsp;least,&nbsp;in&nbsp;the&nbsp;Clojure&nbsp;reader)&nbsp;to&nbsp;rewrite&nbsp;forms&nbsp;like
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                019&nbsp;&nbsp;;;;&nbsp;&quot;&#x27;FOO&quot;,&nbsp;because&nbsp;that&#x27;s&nbsp;handled&nbsp;by&nbsp;the&nbsp;parser.&nbsp;But&nbsp;we&nbsp;do&nbsp;need&nbsp;to&nbsp;rewrite
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                020&nbsp;&nbsp;;;;&nbsp;things&nbsp;which&nbsp;don&#x27;t&nbsp;evaluate&nbsp;their&nbsp;arguments,&nbsp;like&nbsp;`SETQ`,&nbsp;because&nbsp;(unless
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                021&nbsp;&nbsp;;;;&nbsp;LABEL&nbsp;does&nbsp;it,&nbsp;which&nbsp;I&#x27;m&nbsp;not&nbsp;yet&nbsp;sure&nbsp;of)&nbsp;we&#x27;re&nbsp;not&nbsp;yet&nbsp;able&nbsp;to&nbsp;implement
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                022&nbsp;&nbsp;;;;&nbsp;things&nbsp;which&nbsp;don&#x27;t&nbsp;evaluate&nbsp;arguments.
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                023&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                024&nbsp;&nbsp;;;;&nbsp;TODO:&nbsp;at&nbsp;this&nbsp;stage,&nbsp;the&nbsp;following&nbsp;should&nbsp;probably&nbsp;also&nbsp;be&nbsp;read&nbsp;macros:
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                025&nbsp;&nbsp;;;;&nbsp;DEFINE
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                026&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                027&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                028&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                029&nbsp;&nbsp;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2022-2023&nbsp;Simon&nbsp;Brooke
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                030&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                031&nbsp;&nbsp;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                032&nbsp;&nbsp;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                033&nbsp;&nbsp;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                034&nbsp;&nbsp;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                035&nbsp;&nbsp;;;;&nbsp;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                036&nbsp;&nbsp;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                037&nbsp;&nbsp;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                038&nbsp;&nbsp;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                039&nbsp;&nbsp;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                040&nbsp;&nbsp;;;;&nbsp;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                041&nbsp;&nbsp;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                042&nbsp;&nbsp;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                043&nbsp;&nbsp;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,&nbsp;USA.
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                044&nbsp;&nbsp;;;;
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                045&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                </span><br/>
<span class="blank" title="0 out of 0 forms covered">
                046&nbsp;&nbsp;
                </span><br/>
<span class="covered" title="1 out of 1 forms covered">
                047&nbsp;&nbsp;(def&nbsp;^:dynamic&nbsp;*readmacros*
                </span><br/>
<span class="covered" title="6 out of 6 forms covered">
                048&nbsp;&nbsp;&nbsp;&nbsp;{:car&nbsp;{&#x27;DEFUN&nbsp;(fn&nbsp;[f]
                </span><br/>
<span class="covered" title="9 out of 9 forms covered">
                049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(LIST&nbsp;&#x27;SET&nbsp;(LIST&nbsp;&#x27;QUOTE&nbsp;(second&nbsp;f))
                </span><br/>
<span class="covered" title="11 out of 11 forms covered">
                050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(LIST&nbsp;&#x27;QUOTE&nbsp;(CONS&nbsp;&#x27;LAMBDA&nbsp;(rest&nbsp;(rest&nbsp;f))))))
                </span><br/>
<span class="covered" title="13 out of 13 forms covered">
                051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;SETQ&nbsp;(fn&nbsp;[f]&nbsp;(LIST&nbsp;&#x27;SET&nbsp;(LIST&nbsp;&#x27;QUOTE&nbsp;(second&nbsp;f))&nbsp;(nth&nbsp;f&nbsp;2)))}})
                </span><br/>
<span class="blank" title="0 out of 0 forms covered">
                052&nbsp;&nbsp;
                </span><br/>
<span class="covered" title="1 out of 1 forms covered">
                053&nbsp;&nbsp;(defn&nbsp;expand-macros
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                054&nbsp;&nbsp;&nbsp;&nbsp;[form]
                </span><br/>
<span class="covered" title="1 out of 1 forms covered">
                055&nbsp;&nbsp;&nbsp;&nbsp;(try
                </span><br/>
<span class="covered" title="19 out of 19 forms covered">
                056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if-let&nbsp;[car&nbsp;(when&nbsp;(and&nbsp;(coll?&nbsp;form)&nbsp;(symbol?&nbsp;(first&nbsp;form)))&nbsp;
                </span><br/>
<span class="covered" title="3 out of 3 forms covered">
                057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(first&nbsp;form))]
                </span><br/>
<span class="covered" title="10 out of 10 forms covered">
                058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if-let&nbsp;[macro&nbsp;(-&gt;&nbsp;*readmacros*&nbsp;:car&nbsp;car)]
                </span><br/>
<span class="covered" title="8 out of 8 forms covered">
                059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(make-beowulf-list&nbsp;(apply&nbsp;macro&nbsp;(list&nbsp;form)))
                </span><br/>
<span class="covered" title="1 out of 1 forms covered">
                060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form)
                </span><br/>
<span class="covered" title="1 out of 1 forms covered">
                061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form)
                </span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
                062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;any
                </span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
                063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(println&nbsp;(join&nbsp;&quot;\n&quot;
                </span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
                064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;#&nbsp;ERROR&nbsp;while&nbsp;expanding&nbsp;macro:&quot;
                </span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
                065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;#&nbsp;Form:&nbsp;&quot;&nbsp;form)
                </span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
                066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;#&nbsp;Error&nbsp;class:&nbsp;&quot;&nbsp;(.getName&nbsp;(.getClass&nbsp;any)))
                </span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
                067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;#&nbsp;Message:&nbsp;&quot;&nbsp;(.getMessage&nbsp;any))]))
                </span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
                068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form)))
                </span><br/>
 </body>
</html>