packages feed

highlighting-kate-0.5.14: tests/abc.clojure.html

<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #40a070; }
code > span.fl { color: #40a070; }
code > span.ch { color: #4070a0; }
code > span.st { color: #4070a0; }
code > span.co { color: #60a0b0; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #06287e; }
code > span.er { color: #ff0000; font-weight: bold; }
</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">
(<span class="kw" title="KeywordTok">def</span><span class="fu" title="FunctionTok"> blocks</span>
  (<span class="kw" title="KeywordTok">-&gt;</span> <span class="st" title="StringTok">&quot;BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM&quot;</span> (.split <span class="st" title="StringTok">&quot; &quot;</span>) <span class="kw" title="KeywordTok">vec</span>))

(<span class="kw" title="KeywordTok">defn</span><span class="fu" title="FunctionTok"> omit </span>
  <span class="st" title="StringTok">&quot;return bs with (one instance of) b omitted&quot;</span>
  [bs b] 
  (<span class="kw" title="KeywordTok">let</span> [[before after] (<span class="kw" title="KeywordTok">split-with</span> #(<span class="kw" title="KeywordTok">not=</span> b %) bs)]
    (<span class="kw" title="KeywordTok">concat</span> before (<span class="kw" title="KeywordTok">rest</span> after))))

(<span class="kw" title="KeywordTok">defn</span><span class="fu" title="FunctionTok"> abc </span>
  <span class="st" title="StringTok">&quot;return lazy sequence of solutions (i.e. block lists)&quot;</span>
  [blocks [c &amp; cs]]
  (if-some c
    (<span class="kw" title="KeywordTok">for</span> [b blocks <span class="kw" title="KeywordTok">:when</span> (<span class="kw" title="KeywordTok">some</span> #(<span class="kw" title="KeywordTok">=</span> c %) b)
          bs (abc (omit blocks b) cs)]
      (<span class="kw" title="KeywordTok">cons</span> b bs))
    [[]]))
    
      
(<span class="kw" title="KeywordTok">doseq</span> [word [<span class="st" title="StringTok">&quot;A&quot;</span> <span class="st" title="StringTok">&quot;BARK&quot;</span> <span class="st" title="StringTok">&quot;Book&quot;</span> <span class="st" title="StringTok">&quot;treat&quot;</span> <span class="st" title="StringTok">&quot;COMMON&quot;</span> <span class="st" title="StringTok">&quot;SQUAD&quot;</span> <span class="st" title="StringTok">&quot;CONFUSE&quot;</span>]]
  (<span class="kw" title="KeywordTok">-&gt;&gt;</span> word .toUpperCase (abc blocks) <span class="kw" title="KeywordTok">first</span> (<span class="kw" title="KeywordTok">printf</span> <span class="st" title="StringTok">&quot;%s: %b</span>\n<span class="st" title="StringTok">&quot;</span> word)))</code></pre></div></body>