specter/com.rpl.specter.macros.html

22 lines
14 KiB
HTML
Raw Normal View History

2016-06-02 16:03:15 +00:00
<!DOCTYPE html PUBLIC ""
"">
2016-06-02 16:18:11 +00:00
<html><head><meta charset="UTF-8" /><link href="css/default.css" rel="stylesheet" type="text/css" /><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>com.rpl.specter.macros documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Specter</span> <span class="project-version">0.11.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>com</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rpl</span></div></div></li><li class="depth-3"><a href="com.rpl.specter.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specter</span></div></a></li><li class="depth-4 branch current"><a href="com.rpl.specter.macros.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>macros</span></div></a></li><li class="depth-4"><a href="com.rpl.specter.zipper.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>zipper</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="com.rpl.specter.macros.html#var-declarepath"><div class="inner"><span>declarepath</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-defcollector"><div class="inner"><span>defcollector</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-defnav"><div class="inner"><span>defnav</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-defnavconstructor"><div class="inner"><span>defnavconstructor</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-defpathedfn"><div class="inner"><span>defpathedfn</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-defprotocolpath"><div class="inner"><span>defprotocolpath</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-extend-protocolpath"><div class="inner"><span>extend-protocolpath</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-fixed-pathed-nav"><div class="inner"><span>fixed-pathed-nav</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-nav"><div class="inner"><span>nav</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-paramscollector"><div class="inner"><span>paramscollector</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-paramsfn"><div class="inner"><span>paramsfn</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-path"><div class="inner"><span>path</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-pathed-collector"><div class="inner"><span>pathed-collector</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-providepath"><div class="inner"><span>providepath</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-replace-in"><div class="inner"><span>replace-in</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-select"><div class="inner"><span>select</span></div></a></li><li class="depth-1"><a href="com.rpl.specter.macros.html#var-select-first"><div class="inner"><span>select-first</span></div></a><
2016-06-02 16:03:15 +00:00
paths as input. Those paths may require late-bound params, so this helper
will create a parameterized navigator if that is the case. If no late-bound params
2016-06-02 16:18:11 +00:00
are required, then the result is executable.</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L155">view source</a></div></div><div class="public anchor" id="var-nav"><h3>nav</h3><h4 class="type">macro</h4><div class="usage"><code>(nav params impl1 impl2)</code></div><div class="doc"><pre class="plaintext">Defines a navigator with late bound parameters. This navigator can be precompiled
2016-06-02 16:03:15 +00:00
with other navigators without knowing the parameters. When precompiled with other
navigators, the resulting path takes in parameters for all navigators in the path
2016-06-02 16:18:11 +00:00
that needed parameters (in the order in which they were declared).</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L115">view source</a></div></div><div class="public anchor" id="var-paramscollector"><h3>paramscollector</h3><h4 class="type">macro</h4><div class="usage"><code>(paramscollector params impl)</code></div><div class="doc"><pre class="plaintext">Defines a Collector with late bound parameters. This collector can be precompiled
2016-06-02 16:03:15 +00:00
with other selectors without knowing the parameters. When precompiled with other
selectors, the resulting selector takes in parameters for all selectors in the path
that needed parameters (in the order in which they were declared).
2016-06-02 16:18:11 +00:00
</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L137">view source</a></div></div><div class="public anchor" id="var-paramsfn"><h3>paramsfn</h3><h4 class="type">macro</h4><div class="usage"><code>(paramsfn params [structure-sym] &amp; impl)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L126">view source</a></div></div><div class="public anchor" id="var-path"><h3>path</h3><h4 class="type">macro</h4><div class="usage"><code>(path &amp; path)</code></div><div class="doc"><pre class="plaintext">Same as calling comp-paths, except it caches the composition of the static part
2016-06-02 16:03:15 +00:00
of the path for later re-use (when possible). For almost all idiomatic uses
of Specter provides huge speedup. This macro is automatically used by the
2016-06-02 16:18:11 +00:00
select/transform/setval/replace-in/etc. macros.</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L418">view source</a></div></div><div class="public anchor" id="var-pathed-collector"><h3>pathed-collector</h3><h4 class="type">macro</h4><div class="usage"><code>(pathed-collector [name path] impl)</code></div><div class="doc"><pre class="plaintext">This helper is used to define collectors that take in a single selector
2016-06-02 16:03:15 +00:00
paths as input. That path may require late-bound params, so this helper
will create a parameterized selector if that is the case. If no late-bound params
2016-06-02 16:18:11 +00:00
are required, then the result is executable.</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L191">view source</a></div></div><div class="public anchor" id="var-providepath"><h3>providepath</h3><h4 class="type">macro</h4><div class="usage"><code>(providepath name apath)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L300">view source</a></div></div><div class="public anchor" id="var-replace-in"><h3>replace-in</h3><h4 class="type">macro</h4><div class="usage"><code>(replace-in apath transform-fn structure &amp; args)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L522">view source</a></div></div><div class="public anchor" id="var-select"><h3>select</h3><h4 class="type">macro</h4><div class="usage"><code>(select apath structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L504">view source</a></div></div><div class="public anchor" id="var-select-first"><h3>select-first</h3><h4 class="type">macro</h4><div class="usage"><code>(select-first apath structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L513">view source</a></div></div><div class="public anchor" id="var-select-one"><h3>select-one</h3><h4 class="type">macro</h4><div class="usage"><code>(select-one apath structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L510">view source</a></div></div><div class="public anchor" id="var-select-one.21"><h3>select-one!</h3><h4 class="type">macro</h4><div class="usage"><code>(select-one! apath structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L507">view source</a></div></div><div class="public anchor" id="var-setval"><h3>setval</h3><h4 class="type">macro</h4><div class="usage"><code>(setval apath aval structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L519">view source</a></div></div><div class="public anchor" id="var-transform"><h3>transform</h3><h4 class="type">macro</h4><div class="usage"><code>(transform apath transform-fn structure)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L516">view source</a></div></div><div class="public anchor" id="var-variable-pathed-nav"><h3>variable-pathed-nav</h3><h4 class="type">macro</h4><div class="usage"><code>(variable-pathed-nav [latepaths-seq-sym paths-seq] impl1 impl2)</code></div><div class="doc"><pre class="plaintext">This helper is used to define navigators that take in a variable number of other
2016-06-02 16:03:15 +00:00
paths as input. Those paths may require late-bound params, so this helper
will create a parameterized navigator if that is the case. If no late-bound params
2016-06-02 16:18:11 +00:00
are required, then the result is executable.</pre></div><div class="src-link"><a href="https://github.com/nathanmarz/specter/tree/0.11.0/src/clj/com/rpl/specter/macros.clj#L174">view source</a></div></div></div></body></html>