0.1.1 docs





    Apr 9, 2018

    David Mohl


    Index of all namespaces

    « Project + dependencies

    CLJS interface for interacting with Anki

    This file contains the base formats: raw, text and detect.
    url, json and transit are found in their own files.
    This file contains the standard interceptors used by cljs-ajax to implement
    most of the 'magic'. There are four of them: 
      * ProcessGet, which handles the fact that GETs do not have bodies and so need treating separately.
      * ApplyRequestFormat, which takes the request format key and applies it to the params key.
      * ResponseFormat, which is a parameterised interceptor dynamically added to the interceptor list. Note that the response format routines return one of these.
      * DirectSubmission, which spots that you're using a type that doesn't need format processing and sends it immediately.
    There are no functions forming part of the public API in this file, so
    unless you're working on, studying or debugging cljs-ajax, you're 
    probably in the wrong place.
    At first blush, it's pretty bizarre that an entire file is devoted to one  
    function, namely params-to-str, which just takes a map and converts it to
    a querystring. However, it turns out that people sometimes want to encode
    fairly complex maps and the behaviour in the presence of vectors/arrays
    is controversial.
    The basic question is: what {:a [1 2]} be encoded as? The correct answer
    as far as ring is concerned is a=1&a=2. This is also true of most Java
    implementations, ASP.NET, Angular, Haskell and even old-school ASP. This 
    is called vec-strategy :java in the code. Rails and PHP, however, 
    prefer a[]=1&a[]=2, which has an obvious implementation in a dynamic 
    language. This is called vec-strategy :rails. Finally, there's what 
    cljs-ajax (mistakenly) did between versions 0.4.0 and 0.6.x: 
    a[0]=1&a[2]=1, which is called vec-strategy :indexed. This is retained 
    mostly for people who need to keep compatibility with the previous behaviour.
    None of these are the "correct answer": the HTTP standards are
    silent on the subject, so you're left with what your server accepts, and
    different servers have different conventions. Worse, if you send the
    wrong convention it gets misinterpreted. Send strategy :rails to a :java
    server and you get { "a[]" [1 2]}. Worse, send strategy :java to a :rails
    server and you get { "a" 2 }. So it's important to know what your server's
    convention is.
    The situation for maps is simpler, pretty much everyone encodes
    {:a {:b 1}} as "a[b]=1". That is, assuming they process it at all.
    The HTTP spec is similarly silent on this and your server may get your
    language's equivalent of { "a[b]" 1 }. In cases like this, you have two
    choices 1) write your own server-side decoder or 2) don't ever send
    nested maps.
    If you ever wanted to consider exactly how bad the effect of supporting
    a wide range of use cases, consider that this was the original code:
    (defn params-to-str [params]
       (if params
           (-> params      
    This code remains completely correct for at least 90% of actual users
    of cljs-ajax. Now we have ~50 SLOCs achieving much the same result.
    Short utility functions. A lot of these only exist because the 
    cross platform implementation is annoying.
    cljs.core — cljsDocsSource


    - * *1 *2 *3 + - / < <= = == > >=

    A *assert* ->ArrayChunk ->ArrayIter ->ArrayList ->ArrayNode ->ArrayNodeIterator ->ArrayNodeSeq ->Atom accumulating-seq-count aclone add-to-string-hash-cache add-watch aget alength alter-meta! ancestors any? APersistentVector apply apply-to apply-to-simple array array->transient-hash-map array-chunk array-copy array-copy-downward array-extend-kv array-for array-index-of array-index-of-equiv? array-index-of-identical? array-index-of-keyword? array-index-of-nil? array-index-of-symbol? array-iter array-list array-map array-map-extend-kv array-map-index-of array-reduce array-seq array? ArrayChunk ArrayIter ArrayList ArrayNode ArrayNodeIterator ArrayNodeSeq ASeq aset assoc assoc! assoc-in associative? atom Atom

    B ->BitmapIndexedNode ->BlackNode ->Box balance-left balance-left-del balance-right balance-right-del bit-and bit-and-not bit-clear bit-count bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-shift-right-zero-fill bit-test bit-xor bitmap-indexed-node-index BitmapIndexedNode bitpos BlackNode boolean boolean? booleans bounded-count Box build-subvec butlast byte bytes

    C *clojurescript-version* *command-line-args* ->ChunkBuffer ->ChunkedCons ->ChunkedSeq ->Cons cat char char-escapes char? CHAR_MAP chars checked-aget checked-aget' checked-aset checked-aset' chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest ChunkBuffer chunked-seq chunked-seq? ChunkedCons ChunkedSeq chunkIteratorSeq ci-reduce clj->js clone clone-and-set cloneable? coll? comp comparator compare compare-and-set! compare-indexed compare-keywords compare-symbols complement completing concat conj conj! cons Cons constantly contains? count counted? create-array-node-seq create-inode-seq create-node create-ns create-tree-map-seq cycle

    D ->Delay dec dedupe default-dispatch-val Delay delay? demunge demunge-pattern demunge-str DEMUNGE_MAP DEMUNGE_PATTERN deref derive descendants disj disj! dispatch-fn dissoc dissoc! distinct distinct? divide do-assoc doall dominates dorun double double-array double? doubles drop drop-last drop-while

    E *e ->Eduction ->Empty ->EmptyList ->ES6EntriesIterator ->ES6Iterator ->ES6IteratorSeq ->ES6SetEntriesIterator edit-and-set eduction Eduction empty Empty EMPTY empty-ordered-hash empty-unordered-hash empty? EmptyList enable-console-print! ensure-reduced equiv-map equiv-sequential es6-entries-iterator es6-iterator es6-iterator-seq es6-set-entries-iterator ES6EntriesIterator ES6Iterator ES6IteratorSeq ES6SetEntriesIterator even? every-pred every? ex-cause ex-data ex-info ex-message ExceptionInfo extend-object!

    F *flush-on-newline* false? ffirst filter filterv find find-and-cache-best-method find-macros-ns find-ns find-ns-obj find-ns-obj* first first-array-for-longvec fix fixture1 fixture2 flatten flatten1 float float? floats flush Fn fn->comparator fn? fnext fnil force frequencies

    G -global-hierarchy gensym gensym_counter get get-global-hierarchy get-in get-method get-validator group-by

    H ->HashCollisionNode ->HashMapIter ->HashSetIter halt-when hash hash-coll hash-collision-node-find-index hash-combine hash-imap hash-iset hash-keyword hash-map hash-ordered-coll hash-set hash-string hash-string* hash-symbol hash-unordered-coll HashCollisionNode HashMapIter HashSetIter

    I ->IndexedSeq ->IndexedSeqIterator -indexOf IAssociative IAtom IChunk IChunkedNext IChunkedSeq ICloneable ICollection IComparable ICounted ident? identical? identity IDeref IDerefWithTimeout IEditableCollection IEmptyableCollection IEncodeClojure IEncodeJS IEquiv IFind ifind? IFn ifn? IHash IIndexed IIterable IKVReduce IList ILookup IMap IMapEntry IMeta imul IMultiFn INamed inc indexed? IndexedSeq IndexedSeqIterator INext infinite? INIT inode-kv-reduce Inst inst-ms inst? instance? int int-array int-rotate-left int? integer? interleave interpose into into-array ints IPending IPrintWithWriter IRecord IReduce IReset IReversible is_proto_ isa? ISeq ISeqable ISequential ISet ISorted IStack ISwap iter iter-reduce ITER_SYMBOL iterable? iterate ITransientAssociative ITransientCollection ITransientMap ITransientSet ITransientVector IUUID IVector IVolatile IWatchable IWithMeta IWriter

    J js->clj js-delete js-invoke js-keys js-mod js-obj js-reserved js-reserved-arr js-reserved? juxt

    K ->KeySeq ->Keyword keep keep-indexed key key->js key-test keys KeySeq Keyword keyword keyword-identical? keyword?

    L *loaded-libs* ->LazySeq ->List -lastIndexOf last LazySeq lift-ns linear-traversal-nth list List list* list? load-file long long-array longs lookup-sentinel

    M *main-cli-fn* ->Many ->MapEntry ->MetaFn ->MultiFn ->MultiIterator m3-C1 m3-C2 m3-fmix m3-hash-int m3-hash-unencoded-chars m3-mix-H1 m3-mix-K1 m3-seed make-array make-hierarchy Many map map-indexed map? mapcat MapEntry mapv mask max max-key maybe-warn memoize merge merge-with meta MetaFn methods min min-key missing-protocol mix-collection-hash mk-bound-fn mod MODULE_INFOS MODULE_URIS MultiFn MultiIterator munge munge-str

    N *ns* ->Namespace ->NeverEquiv ->NodeIterator ->NodeSeq name namespace Namespace nat-int? native-satisfies? neg-int? neg? never-equiv NeverEquiv new-path newline next nfirst nil-iter nil? nnext NodeIterator NodeSeq NONE not not-any? not-empty not-every? not-native not= ns-interns* ns-lookup ns-name NS_CACHE nth nthnext nthrest number?

    O *out* ->ObjMap obj-clone obj-map obj-map->hash-map obj-map-compare-keys object-array object? ObjMap odd?

    P *print-dup* *print-err-fn* *print-fn* *print-fn-bodies* *print-length* *print-level* *print-meta* *print-namespace-maps* *print-newline* *print-readably* ->PersistentArrayMap ->PersistentArrayMapIterator ->PersistentArrayMapSeq ->PersistentHashMap ->PersistentHashSet ->PersistentQueue ->PersistentQueueIter ->PersistentQueueSeq ->PersistentTreeMap ->PersistentTreeMapSeq ->PersistentTreeSet ->PersistentVector pack-array-node parents partial partition partition-all partition-by peek persistent! persistent-array-map-seq PersistentArrayMap PersistentArrayMapIterator PersistentArrayMapSeq PersistentHashMap PersistentHashSet PersistentQueue PersistentQueueIter PersistentQueueSeq PersistentTreeMap PersistentTreeMapSeq PersistentTreeSet PersistentVector pop pop! pop-tail pos-int? pos? pr pr-opts pr-sb-with-opts pr-seq-writer pr-sequential-writer pr-str pr-str* pr-str-with-opts pr-with-opts pr-writer pr-writer-ex-info pr-writer-impl prefer-method prefers prefers* preserving-reduced prim-seq print print-map print-meta? print-prefix-map print-str println println-str prn prn-str prn-str-with-opts PROTOCOL_SENTINEL push-tail pv-aget pv-aset pv-clone-node pv-fresh-node pv-reduce

    Q qualified-ident? qualified-keyword? qualified-symbol? quot quote-string

    R ->Range ->RangedIterator ->RangeIterator ->RecordIter ->RedNode ->Reduced ->RSeq rand rand-int rand-nth random-sample random-uuid range Range ranged-iterator RangedIterator RangeIterator re-find re-matches re-pattern re-seq realized? record? RecordIter RedNode reduce reduce-kv reduceable? Reduced reduced reduced? reductions regexp? rem remove remove-all-methods remove-method remove-pair remove-watch repeat repeatedly replace replicate reset! reset-cache reset-meta! reset-vals! rest reverse reversible? RSeq rseq rsubseq run!

    S ->SeqIter ->Single ->StringBufferWriter ->StringIter ->Subvec ->Symbol scan-array second select-keys seq seq-iter seq-reduce seq? seqable? SeqIter sequence sequential? set set-from-indexed-seq set-print-err-fn! set-print-fn! set-validator! set? short shorts shuffle simple-ident? simple-keyword? simple-symbol? Single some some-fn some? sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? split-at split-with spread START str string-hash-cache string-hash-cache-count string-iter string-print string? StringBufferWriter StringIter strip-ns subs subseq Subvec subvec swap! swap-global-hierarchy! swap-vals! Symbol symbol symbol-identical? symbol? system-time

    T *target* ->TaggedLiteral ->TransformerIterator ->TransientArrayMap ->TransientHashMap ->TransientHashSet ->TransientVector tagged-literal tagged-literal? TaggedLiteral tail-off take take-last take-nth take-while test throw-no-method-error to-array to-array-2d trampoline transduce transformer-iterator TransformerIterator transient TransientArrayMap TransientHashMap TransientHashSet TransientVector tree-map-add tree-map-append tree-map-kv-reduce tree-map-remove tree-map-replace tree-map-seq-push tree-seq true? truth_ tv-editable-root tv-editable-tail tv-ensure-editable tv-pop-tail tv-push-tail type type->str

    U *unchecked-arrays* *unchecked-if* ->UUID unchecked-add unchecked-add-int unchecked-array-for unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-editable-array-for unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int undefined? underive unreduced unsigned-bit-shift-right update update-in uri? uuid UUID uuid?

    V ->ValSeq ->Var ->VectorNode ->Volatile val vals ValSeq Var var? vary-meta vec vector vector-index-out-of-bounds vector? VectorNode Volatile volatile! volatile? vreset!

    W *warn-on-infer* with-meta write-all

    Z zero? zipmap

    cljs.pprint — cljsDocsSource


    A ->arg-navigator abort? absolute-reposition absolute-tabulation add-core-ns add-english-scales add-padding add-to-buffer ancestor? arg-navigator

    B ->buffer-blob base-str boolean-conditional brackets buffer-blob buffer-blob? buffer-length

    C *code-table* *current-length* *current-level* ->compiled-directive c-write-char cached-compile capitalize-string capitalize-word-writer char-code check-arg-conditional check-enumerated-arg check-flags choice-conditional cl-format code-dispatch collect-clauses column-writer compile-directive compile-format compile-raw-string compiled-directive conditional-newline consume consume-while convert-ratio

    D *default-page-width* directive-table dollar-float downcase-writer

    E ->end-block-t else-separator? emit-nl emit-nl? end-block end-block-t end-block-t? english-cardinal-tens english-cardinal-units english-ordinal-tens english-ordinal-units english-scale-numbers execute-format execute-sub-format expand-fixed exponential-float extract-flags extract-param extract-params

    F *format-str* fixed-float flag-defs float-parts float-parts-base float? format-ascii format-cardinal-english format-error format-integer format-logical-block format-new-roman format-old-roman format-ordinal-english format-roman format-simple-cardinal format-simple-number format-simple-ordinal fresh-line

    G general-float get-column get-field get-fixed get-format-arg get-line get-max-column get-miser-width get-pretty-writer get-section get-sub-section get-writer group-by*

    I ->indent-t inc-s indent indent-t indent-t? init-cap-writer init-navigator insert-decimal insert-scaled-decimal integral? IPrettyFlush iterate-list-of-sublists iterate-main-list iterate-main-sublists iterate-sublist

    J javascript-base-formats justify-clauses

    L ->logical-block level-exceeded linear-nl? logical-block logical-block-or-justify ltrim

    M make-buffer-blob make-end-block-t make-indent-t make-nl-t make-pretty-writer make-start-block-t map->arg-navigator map->buffer-blob map->compiled-directive map->end-block-t map->indent-t map->logical-block map->nl-t map->start-block-t map-params map-passing-context map-ref-type miser-nl? modify-case multi-defn

    N ->nl-t needs-pretty new-roman-table next-arg next-arg-or-nil nl nl-t nl-t?

    O old-roman-table opt-base-str

    P *print-base* *print-circle* *print-lines* *print-miser-width* *print-pprint-dispatch* *print-pretty* *print-radix* *print-right-margin* *print-shared* *print-suppress-namespaces* p-write-char param-pattern plain-character pp-newline pprint pprint-anon-func pprint-array pprint-binding-form pprint-code-list pprint-code-symbol pprint-cond pprint-condp pprint-defn pprint-hold-first pprint-ideref pprint-if pprint-indent pprint-let pprint-list pprint-map pprint-newline pprint-ns pprint-ns-reference pprint-pqueue pprint-reader-macro pprint-set pprint-simple-code-list pprint-simple-default pprint-simple-list pprint-tab pprint-vector pr prefix-count pretty-character pretty-writer pretty-writer? print print-char print-table println prn process-bracket process-clause process-nesting

    R readable-character reader-macros realize-parameter realize-parameter-list relative-reposition relative-tabulation remainders render-clauses right-bracket round-str rtrim

    S *symbol-map* ->start-block-t separator? set-field set-indent set-max-column set-pprint-dispatch simple-dispatch single-defn special-chars special-params special-radix-markers split-at-newline start-block start-block-t start-block-t?

    T table-ize tokens-fit? translate-param tuple-map two-forms type-dispatcher type-map

    U unzip-map upcase-writer update-nl-state use-method

    W write write-buffered-output write-initial-lines write-line write-out write-token write-token-string write-tokens write-white-space

    clojure.walk — cljsDocsSource
    This file defines a generic tree walker for Clojure data
    structures.  It takes any data structure (list, vector, map, set,
    seq), calls a function on every element, and uses the return value
    of the function in place of the original.  This makes it fairly
    easy to write recursive search-and-replace functions, as shown in
    the examples.
    Note: "walk" supports all Clojure data structures EXCEPT maps
    created with sorted-map-by.  There is no (obvious) way to retrieve
    the sorting function.
    The README below is fetched from the published project artifact. Some relative links may be broken.

    Clojars Project


    ClojureScript interface for interacting with Anki

    Pretty much in progress


    Start the nREPL ``` lein repl

    (use ’figwheel-sidecar.repl-api) (start-figwheel!) ```

    Connect to it and run (use 'figwheel-sidecar.repl-api) (cljs-repl)