Skip to content
(defn foo
[{:keys [x]
:or {x (println :set-default)}}]
x)
user> (foo {:x 1})
:set-default
1
(defn put!
"Takes a `ch`, a `msg`, a fn that enables backpressure, one that disables it,
and a no-arg function which, when invoked, closes the upstream source."
([ch msg suspend! resume! close!]
(let [status (atom ::sending)]
(async/put! ch msg
(fn [result]
(if-not result
(when close! (close!))
(do
(ns foami.core
"FOreign Asynchronous Mechanism Interop"
(:require [clojure.core.async :as async]))
(defn put!
"Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure
and when passed `false` disables it, and a no-arg function which, when invoked, closes the
upstream source."
[ch msg backpressure! close!]
(let [status (atom :sending)]
/(((?:[^A-Za-z0-9@@$##￾￿‪-‮]|^))((https?:\/\/)?((?:(?:(?:[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/](?:[_-]|[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/])*)?[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/]\.)*(?:(?:[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/](?:-|[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/])*)?[^/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$// …  ᠎

    -
 - //￾￿‪-‮/]\.)(?:(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-zA-Z@]|$))|(?:(?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx

On the evilness of the clojure array-map and why you should avoid relying on its ordering:

user> (reduce #(assoc %1 %2 %2) (array-map) (range 10))
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9}

user> (reduce #(assoc %1 %2 %2) (array-map) (range 30))
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9, 10 10, 11 11, 12 12, 13 13, 14 14, 15 15, 16 16, 17 17, 18 18, 19 19
, 20 20, 21 21, 22 22, 23 23, 24 24, 25 25, 26 26, 27 27, 28 28, 29 29}
linux-headers-3.12.6-031206-generic_3.12.6-031206.201312201218_amd64.deb
linux-headers-3.12.6-031206_3.12.6-031206.201312201218_all.deb
linux-image-3.12.6-031206-generic_3.12.6-031206.201312201218_amd64.deb
;; example of query that takes results by pairs,
;; and uses the last value of x to create the new chunks, incrementing its value.
(lazy-query (select :items
(limit 2)
(where {:x 1}))
(fn [query coll]
(merge query (where {:x (-> coll last :x inc)}))))
a
a's
able
about
above
according
accordingly
across
actually
after
(extend-type js/NodeList
Seqable
(-seq [array] (array-seq array 0)))
Something went wrong with that request. Please try again.