clojure/core
zhangningboo
这个作者很懒,什么都没留下…
展开
-
clojure figwheel搭建前端,持续更新
创建前端工程 lein new figwheel your-nameF:\workspace-vscode>lein new figwheel ningdr-front:repositories detected in user-level profiles! [:user]See https://github.com/technomancy/leiningen/wiki/Repe...原创 2020-02-25 22:09:28 · 184 阅读 · 0 评论 -
clojure小惊喜-持续更新ing...
1、and:elements全为true,返回最后一个element(some #(and (<= 16 (* % %)) %) (range))=> 4(some #(<= 16 (* % %)) (range))=> true(and 1 2)=> 2(and 1 2 false)=> false(and 1 2 false true)...原创 2019-11-23 11:05:29 · 118 阅读 · 0 评论 -
clojure/core assoc-in
点我查看原文及更多示例(ns $clojureDoc.core.assoc-in);; 使用方式:(assoc-in m [k & ks] v);; Associates a value in a nested associative structure, where ks is a;; sequence of keys and v is the new value and r...原创 2019-06-27 19:22:09 · 259 阅读 · 0 评论 -
clojure/core map-indexed
点我查看原文(ns $clojureDoc.core.map-indexed);; 使用方法:(map-indexed f) (map-indexed f coll);; Returns a lazy sequence consisting of the result of applying f to 0;; and the first item of coll, followed b...原创 2019-06-24 12:38:44 · 204 阅读 · 0 评论 -
clojure/core commute
点我查看原文及更多示例(ns $clojureDoc.core.commute);; 使用方式:(commute ref fun & args);; Must be called in a transaction. Sets the in-transaction-value of;; ref to:;; (apply fun in-transaction-value-of-...原创 2019-06-26 18:58:25 · 164 阅读 · 0 评论 -
clojure/core pcalls
点我查看原文及更多示例(ns $clojureDoc.core.pcalls);; 使用方式:(pcalls & fns);; Executes the no-arg fns in parallel, returning a lazy sequence of;; their values;; 并行执行无参的函数集fns,返回一个由函数执行完后的值组成的惰性序列(def x-...原创 2019-06-26 18:56:25 · 144 阅读 · 0 评论 -
clojure/core future
点我查看原文及更多示例(ns $clojureDoc.core.future);; 使用方式:(future & body);; Takes a body of expressions and yields a future object that will;; invoke the body in another thread, and will cache the resu...原创 2019-06-26 18:27:18 · 208 阅读 · 0 评论 -
clojure/core update-in
点我查看原文及更多示例(ns $clojureDoc.core.update-in);; 使用方法:(update-in m ks f & args);; 'Updates' a value in a nested associative structure, where ks is a;; sequence of keys and f is a function that w...原创 2019-06-23 11:36:21 · 242 阅读 · 0 评论 -
clojure/core atom
点我查看原文及更多示例(ns $clojureDoc.core.atom);; 使用方式:(atom x) (atom x & options);; Creates and returns an Atom with an initial value of x and zero or;; more options (in any order):;; :meta metadat...原创 2019-06-26 15:40:03 · 161 阅读 · 0 评论 -
clojure/core swap!
点我查看原文及更多示例(ns $clojureDoc.core.swap!);; 使用方法:(swap! atom f) (swap! atom f x) (swap! atom f x y) (swap! atom f x y & args);; Atomically swaps the value of atom to be:;; (apply f current-valu...原创 2019-06-26 15:23:18 · 288 阅读 · 0 评论 -
clojure/core lazy-cat
点我查看原文及更多示例(ns $clojureDoc.core.lazy-cat);; 使用方法:(lazy-cat & colls);; Expands to code which yields a lazy sequence of the concatenation;; of the supplied colls. Each coll expr is not evalua...原创 2019-06-26 14:46:24 · 135 阅读 · 0 评论 -
clojure/core sorted-map
点我查看原文及更多示例(ns $clojureDoc.core.sorted-map);; 使用方式:(sorted-map & keyvals);; keyval => key val;; Returns a new sorted map with supplied mappings. If any keys are;; equal, they are handle...原创 2019-06-27 13:52:54 · 125 阅读 · 0 评论 -
clojure/core some
点我查看原文及更多示例(ns $clojureDoc.core.some);; 使用方式:(some pred coll);; Returns the first logical true value of (pred x) for any x in coll,;; else nil. One common idiom is to use a set as pred, for exa...原创 2019-06-27 18:03:24 · 168 阅读 · 0 评论 -
clojure/core vec
点我查看原文及更多示例(ns $clojureDoc.core.vec);; 使用方式:;; Creates a new vector containing the contents of coll. Java arrays;; will be aliased and should not be modified.;; 创建一个包含coll元素的新向量;; java数组将被重命名且...原创 2019-07-11 17:03:16 · 174 阅读 · 0 评论 -
clojure/core every?
点我查看原文及更多示例(ns $clojureDoc.core.every-q);; 使用方式:(every? pred coll);; Returns true if (pred x) is logical true for every x in coll, else false.;; 如果coll中的每一项对于断言/决策都为真,则返回逻辑真,否则返回假(println (eve...原创 2019-07-11 16:31:27 · 183 阅读 · 0 评论 -
clojure/core -> vs ->>
点我查看->官方文档及更多示例点我查看->>官方文档及更多示例(ns $clojureDoc.core.sub-big-vs-sub-big-big);; ->;; 使用方式:(-> x & forms);; Threads the expr through the forms. Inserts x as the;; second item ...原创 2019-06-29 12:46:30 · 443 阅读 · 0 评论 -
clojure/core if-let
点我查看原文及更多示例(ns $clojureDoc.core.if-let);; 使用方式:(if-let bindings then) (if-let bindings then else & oldform);; bindings => binding-form test 绑定的形式可以拆分成绑定+表达式;; 比如绑定是这样写:[x (true? true)];;...原创 2019-06-29 11:03:18 · 326 阅读 · 0 评论 -
clojure/core update
点我查看原文及更多示例(ns $clojureDoc.core.update);; 使用方式:(update m k f) (update m k f x) (update m k f x y) (update m k f x y z) (update m k f x y z & more);; 'Updates' a value in an associative struct...原创 2019-06-29 10:44:07 · 297 阅读 · 0 评论 -
clojure/core slurp
点我查看原文及更多示例(ns $clojureDoc.core.slurp);; 使用方式:(slurp f & opts);; Opens a reader on f and reads all its contents, returning a string.;; See clojure.java.io/reader for a complete list of suppo...原创 2019-06-29 10:16:41 · 274 阅读 · 0 评论 -
clojure/core get-in
点我查看原文及更多示例(ns $clojureDoc.core.get-in);; 使用方式:(get-in m ks) (get-in m ks not-found);; Returns the value in a nested associative structure,;; where ks is a sequence of keys. Returns nil if the k...原创 2019-06-29 09:50:59 · 466 阅读 · 0 评论 -
clojure/core not-any?
点我查看原文及更多示例(ns $clojureDoc.core.not-any-y);; 使用方式:(not-any? pred coll);; Returns false if (pred x) is logical true for any x in coll, else true.;; 无论coll中存在几个x,只要断言/决策和x运算的返回值为逻辑真,那么not-any?返回假,...原创 2019-07-04 15:39:03 · 130 阅读 · 0 评论 -
clojure/core zipmap
点我查看原文(ns $clojureDoc.core.zipmap);; 使用方法:(zipmap keys vals);; Returns a map with the keys mapped to the corresponding vals.;; 返回一个map:由keys集合做key,由vals集合做value,keys的数量应该和vals的数量一致(def x (zipma...原创 2019-06-23 00:02:27 · 147 阅读 · 0 评论 -
clojure/core frequencies
点我查看原文(ns $clojureDoc.core.frequencies);; 使用方法:(frequencies coll);; Returns a map from distinct items in coll to the number of times they appear.;; 返回一个map:集合中每一个唯一项作为key,出现的次数作为value(println ...原创 2019-06-22 23:52:36 · 117 阅读 · 0 评论 -
clojure/core drop-last
点我查看原文(ns $clojureDoc.core.drop-last);; 使用方法:(drop-last coll) (drop-last n coll);; Return a lazy sequence of all but the last n (default 1) items in coll;; 去掉coll的最后n项,默认为1项(println (drop-last...原创 2019-06-20 15:20:26 · 287 阅读 · 0 评论 -
clojure/core butlast
点我查看原文(ns $clojureDoc.core.butlast);; 使用方法:(butlast coll);; Return a seq of all but the last item in coll, in linear time;; 时间复杂度是线性的;返回一个除了最后一项的序列(这就是rest的相反操作啊);; 掐头(println (rest '(1 2 3 4)...原创 2019-06-20 15:15:47 · 141 阅读 · 0 评论 -
clojure/core interpose
点我查看原文(ns $clojureDoc.core.interpose);; 使用方法:(interpose sep) (interpose sep coll);; Returns a lazy seq of the elements of coll separated by sep.;; 返回一个元素由sep分隔的一个惰性序列;; Returns a stateful trans...原创 2019-06-20 15:09:48 · 177 阅读 · 0 评论 -
clojure/core reduce
点我查看原文(ns $clojureDoc.core.reduce);; 使用方法:(reduce f coll) (reduce f val coll);; f should be a function of 2 arguments.;; 函数f需要两个参数;; If val is not supplied, returns the result of applying f to...原创 2019-06-20 14:34:05 · 225 阅读 · 0 评论 -
clojure/core reductions
点我查看原文(ns $clojureDoc.core.reductions);; 使用方法:(reductions f coll)(reductions f init coll);; Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting w...原创 2019-06-20 13:03:09 · 122 阅读 · 0 评论 -
clojure/core merge
点我查看原文(ns $clojureDoc.core.merge);; 使用方法:(merge & maps);; Returns a map that consists of the rest of the maps conj-ed onto;; the first. If a key occurs in more than one map, the mapping fro...原创 2019-06-20 12:47:17 · 245 阅读 · 0 评论 -
clojure/core take-while
点我查看原文(ns $clojureDoc.core.take-while);; 使用方法:(take-while pred)(take-while pred coll);; Returns a lazy sequence of successive items from coll while;; (pred item) returns logical true. pred must ...原创 2019-06-20 12:24:14 · 178 阅读 · 0 评论 -
clojure/core iterate
点我查看原文(ns $clojureDoc.core.iterate);; 使用方法 (iterate f x);; Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects;; 返回一个惰性序列:第一项是x,第二项是(f x)的结果,第三项是(f (f x))的结果,即每一次的...原创 2019-06-20 12:04:01 · 141 阅读 · 0 评论 -
clojure/core sequential?
点我查看原文(ns $clojureDoc.core.sequential);; 使用方法 (sequential? coll);; Returns true if coll implements Sequential;; 如果集合实现了Sequential接口,返回 true(sequential? '(1 2 3));; => true(sequential? [1 ...翻译 2019-06-14 12:12:43 · 117 阅读 · 0 评论 -
clojure/core assoc
点我查看原文(ns $clojureDoc.core.assoc);; (assoc map key val)(assoc map key val & kvs);; 使用方式;; assoc[iate]. When applied to a map, returns a new map of the;; same (hashed/sorted) type, that cont...原创 2019-06-16 16:10:26 · 356 阅读 · 0 评论 -
clojure/core cons
点我查看原文(ns $clojureDoc.core.cons);; (cons x seq);; Returns a new seq where x is the first element and seq is the rest.;; 把x作为元素放在序列seq的第一位并返回一个新序列(println (cons 1 [2 3 4]));; => (1 2 3 4)(p...原创 2019-06-16 16:25:00 · 122 阅读 · 0 评论 -
clojure/core when-let
点我查看原文及更多例子(ns $clojureDoc.core.when-let);; 使用方法:(when-let bindings & body);; bindings => binding-form test;; When test is true, evaluates body with binding-form bound to the value of tes...原创 2019-06-22 23:17:55 · 337 阅读 · 0 评论 -
clojure/core vals
点我查看原文及更多示例(ns $clojureDoc.core.vals);; 使用方法:(vals map);; Returns a sequence of the map's values, in the same order as (seq map).;; 返回一个由map的值组成的序列,序列的顺序和(seq map)的顺序一致(println (vals {true [1 ...原创 2019-06-22 15:15:50 · 104 阅读 · 0 评论 -
clojure/core comp
点我查看原文及更多示例(ns $clojureDoc.core.comp);; 使用方法:(comp)(comp f)(comp f g)(comp f g & fs);; Takes a set of functions and returns a fn that is the composition;; of those fns. The returned fn take...原创 2019-06-22 15:11:21 · 176 阅读 · 0 评论 -
clojure/core subvec
点我查看原文及更多示例(ns $clojureDoc.core.subvec);; 使用方法:(subvec v start) (subvec v start end);; Returns a persistent vector of the items in vector from;; start (inclusive) to end (exclusive). If end is ...原创 2019-06-22 13:44:20 · 254 阅读 · 0 评论 -
clojure/core juxt
点我查看原文及更多示例(ns $clojureDoc.core.juxt);; 使用方法:(juxt f) (juxt f g) (juxt f g h) (juxt f g h & fs);; Takes a set of functions and returns a fn that is the juxtaposition;; of those fns. The ret...原创 2019-06-22 12:19:53 · 250 阅读 · 0 评论 -
clojure/core mapv
点我查看原文(ns $clojureDoc.core.mapv);; 使用方法:(mapv f coll) (mapv f c1 c2) (mapv f c1 c2 c3) (mapv f c1 c2 c3 & colls);; Returns a vector consisting of the result of applying f to the;; set of fir...原创 2019-06-21 15:24:40 · 232 阅读 · 0 评论