walkmap/docs/codox/walkmap.utils.html

5 lines
8.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>walkmap.utils documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></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">Walkmap</span> <span class="project-version">0.1.0-SNAPSHOT</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">Topics</span></h3><ul><li class="depth-1 "><a href="dali-performance.html"><div class="inner"><span>Dali performance</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to walkmap</span></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>walkmap</span></div></div></li><li class="depth-2 branch"><a href="walkmap.edge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>edge</span></div></a></li><li class="depth-2 branch"><a href="walkmap.id.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>id</span></div></a></li><li class="depth-2 branch"><a href="walkmap.ocean.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ocean</span></div></a></li><li class="depth-2 branch"><a href="walkmap.path.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>path</span></div></a></li><li class="depth-2 branch"><a href="walkmap.polygon.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>polygon</span></div></a></li><li class="depth-2 branch"><a href="walkmap.read-svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read-svg</span></div></a></li><li class="depth-2 branch"><a href="walkmap.routing.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routing</span></div></a></li><li class="depth-2 branch"><a href="walkmap.stl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>stl</span></div></a></li><li class="depth-2 branch"><a href="walkmap.superstructure.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>superstructure</span></div></a></li><li class="depth-2 branch"><a href="walkmap.svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>svg</span></div></a></li><li class="depth-2 branch"><a href="walkmap.tag.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tag</span></div></a></li><li class="depth-2 branch current"><a href="walkmap.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="walkmap.vertex.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vertex</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="walkmap.utils.html#var-.3Dish"><div class="inner"><span>=ish</span></div></a></li><li class="depth-1"><a href="walkmap.utils.html#var-check-kind-type"><div class="inner"><span>check-kind-type</span></div></a></li><li class="depth-1"><a href="walkmap.utils.html#var-check-kind-type-seq"><div class="inner"><span>check-kind-type-seq</span></div></a></li><li class="depth-1"><a href="walkmap.utils.html#var-deep-merge"><div class="inner"><span>deep-merge</span></div></a></li><li class="depth-1"><a href="walkmap.utils.html#var-kind-type"><div class="inner"><span>kind-type</span></div></a></li><li class="depth-1"><a href="walkmap.utils.html#var-truncate"><div class="inner"><span>truncate</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">walkmap.utils</h1><div class="doc"><div class="markdown"><p>Miscellaneous utility functions.</p></div></div><div class="public anchor" id="var-.3Dish"><h3>=ish</h3><div class="usage"><code>(=ish n1 n2)</code><code>(=ish n1 n2 tolerance)</code></div><div class="doc"><div class="markdown"><p>True if numbers <code>n1</code>, <code>n2</code> are roughly equal; that is to say, equal to within <code>tolerance</code> (defaults to one part in a million).</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L32">view source</a></div></div><div class="public anchor" id="var-check-kind-type"><h3>check-kind-type</h3><h4 class="type">macro</h4><div class="usage"><code>(check-kind-type object expected)</code><code>(check-kind-type object checkfn expected)</code></div><div class="doc"><div class="markdown"><p>If <code>object</code> is not of kind-type <code>expected</code>, throws an IllegalArgumentException with an appropriate message; otherwise, returns <code>object</code>. If <code>checkfn</code> is supplied, it should be a function which tests whether the object is of the expected kind-type.</p>
<p>Macro, so that the exception is thrown from the calling function.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L46">view source</a></div></div><div class="public anchor" id="var-check-kind-type-seq"><h3>check-kind-type-seq</h3><h4 class="type">macro</h4><div class="usage"><code>(check-kind-type-seq s expected)</code><code>(check-kind-type-seq s checkfn expected)</code></div><div class="doc"><div class="markdown"><p>If some item on sequence <code>s</code> is not of the <code>expected</code> kind-type, throws an IllegalArgumentException with an appropriate message; otherwise, returns <code>object</code>. If <code>checkfn</code> is supplied, it should be a function which tests whether the object is of the expected kind-type.</p>
<p>Macro, so that the exception is thrown from the calling function.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L70">view source</a></div></div><div class="public anchor" id="var-deep-merge"><h3>deep-merge</h3><div class="usage"><code>(deep-merge &amp; vals)</code></div><div class="doc"><div class="markdown"><p>Recursively merges maps. If vals are not maps, the last value wins.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L6">view source</a></div></div><div class="public anchor" id="var-kind-type"><h3>kind-type</h3><div class="usage"><code>(kind-type object)</code></div><div class="doc"><div class="markdown"><p>Identify the type of an <code>object</code>, e.g. for logging. If it has a <code>:kind</code> key, its one of ours, and thats what we want. Otherwise, we want its type; but the type of <code>nil</code> is <code>nil</code>, which doesnt get printed when assembling error ,essages, so return “nil”.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L24">view source</a></div></div><div class="public anchor" id="var-truncate"><h3>truncate</h3><div class="usage"><code>(truncate s n)</code></div><div class="doc"><div class="markdown"><p>If string <code>s</code> is more than <code>n</code> characters long, return the first <code>n</code> characters; otherwise, return <code>s</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/utils.clj#L16">view source</a></div></div></div></body></html>