Public Vars
- * (clj)
- *' (clj)
- *1 (clj)
- *2 (clj)
- *3 (clj)
- *clojure-version* (clj)
- *data-readers* (clj)
- *default-data-reader-fn* (clj)
- *e (clj)
- *print-length* (clj)
- *print-level* (clj)
- *print-namespace-maps* (clj)
- *repl* (clj)
- *verbose-defrecords* (clj)
- + (clj)
- +' (clj)
- - (clj)
- -' (clj)
- -> (clj)
- ->> (clj)
- ->ArrayChunk (clj)
- ->Eduction (clj)
- ->Vec (clj)
- ->VecNode (clj)
- ->VecSeq (clj)
- -cache-protocol-fn (clj)
- -reset-methods (clj)
- .. (clj)
- / (clj)
- < (clj)
- <= (clj)
- = (clj)
- == (clj)
- > (clj)
- >= (clj)
- ArrayChunk (clj)
- ArrayManager (clj)
- EMPTY-NODE (clj)
- Eduction (clj)
- IVecImpl (clj)
- Inst (clj)
- NaN? (clj)
- PrintWriter-on (clj)
- StackTraceElement->vec (clj)
- Throwable->map (clj)
- Vec (clj)
- VecNode (clj)
- VecSeq (clj)
- abs (clj)
- accessor (clj)
- aclone (clj)
- add-classpath (clj)
- add-tap (clj)
- add-watch (clj)
- agent (clj)
- agent-error (clj)
- agent-errors (clj)
- aget (clj)
- alength (clj)
- alias (clj)
- all-ns (clj)
- alter (clj)
- alter-meta! (clj)
- alter-var-root (clj)
- amap (clj)
- ancestors (clj)
- and (clj)
- any? (clj)
- apply (clj)
- areduce (clj)
- array (clj)
- array-map (clj)
- arrayFor (clj)
- as-> (clj)
- aset (clj)
- assert (clj)
- assoc (clj)
- assoc! (clj)
- assoc-in (clj)
- associative? (clj)
- atom (clj)
- await (clj)
- await-for (clj)
- await1 (clj)
- bases (clj)
- bean (clj)
- bigdec (clj)
- bigint (clj)
- biginteger (clj)
- binding (clj)
- bit-and (clj)
- bit-and-not (clj)
- bit-clear (clj)
- bit-flip (clj)
- bit-not (clj)
- bit-or (clj)
- bit-set (clj)
- bit-shift-left (clj)
- bit-shift-right (clj)
- bit-test (clj)
- bit-xor (clj)
- boolean (clj)
- boolean-array (clj)
- boolean? (clj)
- bound-fn (clj)
- bound-fn* (clj)
- bound? (clj)
- bounded-count (clj)
- butlast (clj)
- byte (clj)
- byte-array (clj)
- bytes? (clj)
- case (clj)
- cast (clj)
- cat (clj)
- char (clj)
- char-array (clj)
- char-escape-string (clj)
- char-name-string (clj)
- char? (clj)
- chunk (clj)
- chunk-append (clj)
- chunk-buffer (clj)
- chunk-cons (clj)
- chunk-first (clj)
- chunk-next (clj)
- chunk-rest (clj)
- chunked-seq? (clj)
- class (clj)
- class? (clj)
- clear-agent-errors (clj)
- clojure-version (clj)
- coll? (clj)
- comment (clj)
- commute (clj)
- comp (clj)
- comparator (clj)
- compare (clj)
- compare-and-set! (clj)
- compile (clj)
- complement (clj)
- completing (clj)
- concat (clj)
- cond (clj)
- cond-> (clj)
- cond->> (clj)
- condp (clj)
- conj (clj)
- conj! (clj)
- cons (clj)
- constantly (clj)
- construct-proxy (clj)
- contains? (clj)
- count (clj)
- counted? (clj)
- create-ns (clj)
- create-struct (clj)
- cycle (clj)
- dec (clj)
- dec' (clj)
- decimal? (clj)
- declare (clj)
- dedupe (clj)
- default-data-readers (clj)
- definline (clj)
- definterface (clj)
- defmacro (clj)
- defmethod (clj)
- defmulti (clj)
- defn (clj)
- defn- (clj)
- defonce (clj)
- defprotocol (clj)
- defrecord (clj)
- defstruct (clj)
- deftype (clj)
- delay (clj)
- delay? (clj)
- deliver (clj)
- denominator (clj)
- deref (clj)
- derive (clj)
- descendants (clj)
- destructure (clj)
- disj (clj)
- disj! (clj)
- dissoc (clj)
- dissoc! (clj)
- distinct (clj)
- distinct? (clj)
- doAssoc (clj)
- doall (clj)
- dorun (clj)
- doseq (clj)
- dosync (clj)
- dotimes (clj)
- doto (clj)
- double (clj)
- double-array (clj)
- double? (clj)
- drop (clj)
- drop-last (clj)
- drop-while (clj)
- eduction (clj)
- empty (clj)
- empty? (clj)
- ensure (clj)
- ensure-reduced (clj)
- enumeration-seq (clj)
- error-handler (clj)
- error-mode (clj)
- eval (clj)
- even? (clj)
- every-pred (clj)
- every? (clj)
- ex-cause (clj)
- ex-data (clj)
- ex-info (clj)
- ex-message (clj)
- extend (clj)
- extend-protocol (clj)
- extend-type (clj)
- extenders (clj)
- extends? (clj)
- false? (clj)
- ffirst (clj)
- file-seq (clj)
- filter (clj)
- filterv (clj)
- find (clj)
- find-keyword (clj)
- find-ns (clj)
- find-protocol-impl (clj)
- find-protocol-method (clj)
- find-var (clj)
- first (clj)
- flatten (clj)
- float (clj)
- float-array (clj)
- float? (clj)
- flush (clj)
- fn (clj)
- fn? (clj)
- fnext (clj)
- fnil (clj)
- for (clj)
- force (clj)
- format (clj)
- frequencies (clj)
- future (clj)
- future-call (clj)
- future-cancel (clj)
- future-cancelled? (clj)
- future-done? (clj)
- future? (clj)
- gen-class (clj)
- gen-interface (clj)
- gensym (clj)
- get (clj)
- get-in (clj)
- get-method (clj)
- get-proxy-class (clj)
- get-thread-bindings (clj)
- get-validator (clj)
- global-hierarchy (clj)
- group-by (clj)
- halt-when (clj)
- hash (clj)
- hash-combine (clj)
- hash-map (clj)
- hash-ordered-coll (clj)
- hash-set (clj)
- hash-unordered-coll (clj)
- ident? (clj)
- identical? (clj)
- identity (clj)
- if-let (clj)
- if-not (clj)
- if-some (clj)
- ifn? (clj)
- import (clj)
- inc (clj)
- inc' (clj)
- indexed? (clj)
- infinite? (clj)
- init-proxy (clj)
- inst-ms (clj)
- inst-ms* (clj)
- inst? (clj)
- instance? (clj)
- int (clj)
- int-array (clj)
- int? (clj)
- integer? (clj)
- interleave (clj)
- intern (clj)
- interpose (clj)
- into (clj)
- into-array (clj)
- io! (clj)
- isa? (clj)
- iterate (clj)
- iteration (clj)
- iterator-seq (clj)
- juxt (clj)
- keep (clj)
- keep-indexed (clj)
- key (clj)
- keys (clj)
- keyword (clj)
- keyword? (clj)
- last (clj)
- lazy-cat (clj)
- lazy-seq (clj)
- let (clj)
- letfn (clj)
- line-seq (clj)
- list (clj)
- list* (clj)
- list? (clj)
- load (clj)
- load-reader (clj)
- load-string (clj)
- loaded-libs (clj)
- locking (clj)
- long (clj)
- long-array (clj)
- loop (clj)
- macroexpand (clj)
- macroexpand-1 (clj)
- make-array (clj)
- make-hierarchy (clj)
- map (clj)
- map-entry? (clj)
- map-indexed (clj)
- map? (clj)
- mapcat (clj)
- mapv (clj)
- max (clj)
- max-key (clj)
- memfn (clj)
- memoize (clj)
- merge (clj)
- merge-with (clj)
- meta (clj)
- method-sig (clj)
- methods (clj)
- min (clj)
- min-key (clj)
- mix-collection-hash (clj)
- mod (clj)
- munge (clj)
- name (clj)
- namespace (clj)
- namespace-munge (clj)
- nat-int? (clj)
- neg-int? (clj)
- neg? (clj)
- newPath (clj)
- newline (clj)
- next (clj)
- nfirst (clj)
- nil? (clj)
- nnext (clj)
- not (clj)
- not-any? (clj)
- not-empty (clj)
- not-every? (clj)
- not= (clj)
- ns (clj)
- ns-aliases (clj)
- ns-imports (clj)
- ns-interns (clj)
- ns-map (clj)
- ns-name (clj)
- ns-publics (clj)
- ns-refers (clj)
- ns-resolve (clj)
- ns-unalias (clj)
- ns-unmap (clj)
- nth (clj)
- nthnext (clj)
- nthrest (clj)
- num (clj)
- number? (clj)
- numerator (clj)
- object-array (clj)
- odd? (clj)
- or (clj)
- parents (clj)
- parse-boolean (clj)
- parse-double (clj)
- parse-long (clj)
- parse-uuid (clj)
- partial (clj)
- partition (clj)
- partition-all (clj)
- partition-by (clj)
- partitionv (clj)
- partitionv-all (clj)
- pcalls (clj)
- peek (clj)
- persistent! (clj)
- pmap (clj)
- pop (clj)
- pop! (clj)
- pop-thread-bindings (clj)
- popTail (clj)
- pos-int? (clj)
- pos? (clj)
- pr (clj)
- pr-str (clj)
- prefer-method (clj)
- prefers (clj)
- primitives-classnames (clj)
- print (clj)
- print-ctor (clj)
- print-dup (clj)
- print-method (clj)
- print-simple (clj)
- print-str (clj)
- printf (clj)
- println (clj)
- println-str (clj)
- prn (clj)
- prn-str (clj)
- process-annotation (clj)
- promise (clj)
- proxy (clj)
- proxy-call-with-super (clj)
- proxy-mappings (clj)
- proxy-name (clj)
- proxy-super (clj)
- push-thread-bindings (clj)
- pushTail (clj)
- pvalues (clj)
- qualified-ident? (clj)
- qualified-keyword? (clj)
- qualified-symbol? (clj)
- quot (clj)
- rand (clj)
- rand-int (clj)
- rand-nth (clj)
- random-sample (clj)
- random-uuid (clj)
- range (clj)
- ratio? (clj)
- rational? (clj)
- rationalize (clj)
- re-find (clj)
- re-groups (clj)
- re-matcher (clj)
- re-matches (clj)
- re-pattern (clj)
- re-seq (clj)
- read (clj)
- read+string (clj)
- read-line (clj)
- read-string (clj)
- reader-conditional (clj)
- reader-conditional? (clj)
- realized? (clj)
- record? (clj)
- reduce (clj)
- reduce-kv (clj)
- reduced (clj)
- reduced? (clj)
- reductions (clj)
- ref (clj)
- ref-history-count (clj)
- ref-max-history (clj)
- ref-min-history (clj)
- ref-set (clj)
- refer (clj)
- refer-clojure (clj)
- reify (clj)
- release-pending-sends (clj)
- rem (clj)
- remove (clj)
- remove-all-methods (clj)
- remove-method (clj)
- remove-ns (clj)
- remove-tap (clj)
- remove-watch (clj)
- repeat (clj)
- repeatedly (clj)
- replace (clj)
- replicate (clj)
- require (clj)
- requiring-resolve (clj)
- reset! (clj)
- reset-meta! (clj)
- reset-vals! (clj)
- resolve (clj)
- rest (clj)
- restart-agent (clj)
- resultset-seq (clj)
- reverse (clj)
- reversible? (clj)
- rseq (clj)
- rsubseq (clj)
- run! (clj)
- satisfies? (clj)
- second (clj)
- select-keys (clj)
- send (clj)
- send-off (clj)
- send-via (clj)
- seq (clj)
- seq-to-map-for-destructuring (clj)
- seq? (clj)
- seqable? (clj)
- seque (clj)
- sequence (clj)
- sequential? (clj)
- set (clj)
- set-agent-send-executor! (clj)
- set-agent-send-off-executor! (clj)
- set-error-handler! (clj)
- set-error-mode! (clj)
- set-validator! (clj)
- set? (clj)
- short (clj)
- short-array (clj)
- shuffle (clj)
- shutdown-agents (clj)
- simple-ident? (clj)
- simple-keyword? (clj)
- simple-symbol? (clj)
- slurp (clj)
- some (clj)
- some-> (clj)
- some->> (clj)
- some-fn (clj)
- some? (clj)
- sort (clj)
- sort-by (clj)
- sorted-map (clj)
- sorted-map-by (clj)
- sorted-set (clj)
- sorted-set-by (clj)
- sorted? (clj)
- special-symbol? (clj)
- spit (clj)
- split-at (clj)
- split-with (clj)
- splitv-at (clj)
- str (clj)
- string? (clj)
- struct (clj)
- struct-map (clj)
- subs (clj)
- subseq (clj)
- subvec (clj)
- supers (clj)
- swap! (clj)
- swap-vals! (clj)
- symbol (clj)
- symbol? (clj)
- sync (clj)
- tagged-literal (clj)
- tagged-literal? (clj)
- tailoff (clj)
- take (clj)
- take-last (clj)
- take-nth (clj)
- take-while (clj)
- tap> (clj)
- test (clj)
- the-ns (clj)
- thread-bound? (clj)
- time (clj)
- to-array (clj)
- to-array-2d (clj)
- trampoline (clj)
- transduce (clj)
- transient (clj)
- tree-seq (clj)
- true? (clj)
- type (clj)
- unchecked-add (clj)
- unchecked-add-int (clj)
- unchecked-byte (clj)
- unchecked-char (clj)
- unchecked-dec (clj)
- unchecked-dec-int (clj)
- unchecked-divide-int (clj)
- unchecked-double (clj)
- unchecked-float (clj)
- unchecked-inc (clj)
- unchecked-inc-int (clj)
- unchecked-int (clj)
- unchecked-long (clj)
- unchecked-multiply (clj)
- unchecked-multiply-int (clj)
- unchecked-negate (clj)
- unchecked-negate-int (clj)
- unchecked-remainder-int (clj)
- unchecked-short (clj)
- unchecked-subtract (clj)
- unchecked-subtract-int (clj)
- underive (clj)
- unquote (clj)
- unquote-splicing (clj)
- unreduced (clj)
- unsigned-bit-shift-right (clj)
- update (clj)
- update-in (clj)
- update-keys (clj)
- update-proxy (clj)
- update-vals (clj)
- uri? (clj)
- use (clj)
- uuid? (clj)
- val (clj)
- vals (clj)
- var-get (clj)
- var-set (clj)
- var? (clj)
- vary-meta (clj)
- vec (clj)
- vector (clj)
- vector-of (clj)
- vector? (clj)
- volatile! (clj)
- volatile? (clj)
- vreset! (clj)
- vswap! (clj)
- when (clj)
- when-first (clj)
- when-let (clj)
- when-not (clj)
- when-some (clj)
- while (clj)
- with-bindings (clj)
- with-bindings* (clj)
- with-in-str (clj)
- with-loading-context (clj)
- with-local-vars (clj)
- with-meta (clj)
- with-open (clj)
- with-out-str (clj)
- with-precision (clj)
- with-redefs (clj)
- with-redefs-fn (clj)
- xml-seq (clj)
- zero? (clj)
- zipmap (clj)
Back
abs (clj)
(source)function
(abs a)
Returns the absolute value of a.
If a is Long/MIN_VALUE => Long/MIN_VALUE
If a is a double and zero => +0.0
If a is a double and ##Inf or ##-Inf => ##Inf
If a is a double and ##NaN => ##NaN
Examples
clojure
(ns clojure.test-clojure.reducers
(:require [clojure.core.reducers :as r]
[clojure.test.generative :refer (defspec)]
[clojure.data.generators :as gen])
(:use clojure.test))
(defequivtest test-map
[map r/map #(into [] %)]
[inc dec #(Math/sqrt (Math/abs %))])
mikera/core.matrix
(ns clojure.core.matrix.macros-clj
"Namespace for core.matrix macros. Keeping them separate allows us to do conditional
macros that can handle the differences between Clojure and Clojurescript."
(:require [clojure.core.matrix.macros :refer [TODO c-for]])
(:import [java.util Arrays]))
(defmacro eps== [a b eps]
`(<= (Math/abs (- (double ~a) (double ~b))) (double ~eps) ))
hraberg/deuce
(ns deuce.emacs.floatfns
(:use [deuce.emacs-lisp :only (defun defvar)])
(:require [clojure.core :as c]
[deuce.emacs.alloc :as alloc])
(:refer-clojure :exclude [float]))
(defun abs (arg)
"Return the absolute value of ARG."
(if (float? arg)
(Math/abs (double arg))
(Math/abs (long arg))))
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
"Type annotations for the base Clojure distribution."
#?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
(:require [clojure.core :as cc]
[typed.clojure :as t]
#?(:clj [typed.ann-macros.clojure :as macros])
#?(:clj typed.ann.clojure.jvm) ;; jvm annotations
#?(:clj clojure.core.typed))
#?(:clj
(:import (clojure.lang PersistentHashSet PersistentList
APersistentMap #_IPersistentCollection
#_ITransientSet
IRef)
(java.util Comparator Collection))))
cc/abs (t/IFn #?(:clj [Long :-> Long])
#?(:clj [Double :-> Double])
[t/Num :-> t/Num])
#?@(:cljs [] :default [
clojure.math.numeric-tower/floor (t/IFn [t/AnyInteger :-> t/AnyInteger]
[t/Num :-> t/Num])
clojure.math.numeric-tower/abs (t/IFn [t/AnyInteger :-> t/AnyInteger]
[t/Num :-> t/Num])
])
re-path/studio
(ns renderer.tools.arc
(:require
["svg-path-bbox" :as svg-path-bbox]
[clojure.core.matrix :as mat]
[goog.math]
[re-frame.core :as rf]
[renderer.attribute.angle :as angle]
[renderer.attribute.hierarchy :as hierarchy]
[renderer.element.handlers :as element.h]
[renderer.overlay :as overlay]
[renderer.tools.base :as tools]
[renderer.utils.pointer :as pointer]
[renderer.utils.units :as units]))
(defmethod tools/drag :arc
[{:keys [adjusted-pointer-offset active-document adjusted-pointer-pos] :as db}]
(let [{:keys [stroke fill]} (get-in db [:documents active-document])
[offset-x offset-y] adjusted-pointer-offset
[pos-x pos-y] adjusted-pointer-pos
attrs {:cx offset-x
:cy offset-y
::start-deg 90
::end-deg 180
:fill fill
:stroke stroke
:rx (abs (- pos-x offset-x))
:ry (abs (- pos-y offset-y))}]
(element.h/set-temp db {:type :element :tag :arc :attrs attrs})))
(defmethod tools/edit :arc
[element [x y] handler]
(case handler
:rx (hierarchy/update-attr element :rx #(abs (+ % x)))
:ry (hierarchy/update-attr element :ry #(abs (- % y)))
element))
re-path/studio
(ns renderer.tools.page
(:require
[clojure.core.matrix :as mat]
[clojure.string :as str]
[goog.string :as g.str]
[re-frame.core :as rf]
[reagent.dom.server :as dom]
[renderer.element.handlers :as element.h]
[renderer.tools.base :as tools]
[renderer.utils.pointer :as pointer]
[renderer.utils.units :as units]))
(defmethod tools/drag :page
[{:keys [adjusted-pointer-pos adjusted-pointer-offset] :as db} e]
(let [[offset-x offset-y] adjusted-pointer-offset
[pos-x pos-y] adjusted-pointer-pos
lock-ratio? (contains? (:modifiers e) :ctrl)
width (abs (- pos-x offset-x))
height (abs (- pos-y offset-y))
attrs {:x (min pos-x offset-x)
:y (min pos-y offset-y)
:width (if lock-ratio? (min width height) width)
:height (if lock-ratio? (min width height) height)
:fill "#ffffff"}]
(element.h/set-temp db {:tag :page
:type :element
:name "Page"
:attrs attrs})))