;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@82 Convert ALIST to a HASH. HASH-TABLE-ARGS are passed to the hash-table creation. (defalias 'kvalist->hash #[(alist &rest hash-table-args) "\303\304\"\305\306\n\"\210 )\207" [hash-table-args table alist apply make-hash-table mapc #[(pair) "\302@A #\207" [pair table puthash] 4]] 3 (#$ . 87)]) #@160 Convert HASH to an ALIST. Optionally filter through FUNC, only non-nil values returned from FUNC are stored as the resulting value against the converted key. (defalias 'kvhash->alist #[(hash &optional func) "\205 \302\303\304\"\210 )\207" [hash store nil maphash #[(key value) "\205#\305 !\203 \n\"\211\205\306 \f#\211)\207\306\n\f#\211\207" [key func value res store functionp acons] 5]] 3 (#$ . 390)]) #@161 Call RECEIVE with whatever comes out of ALIST for KEY. RECEIVE can do whatever destructuring you want, the first argument is always the car of the alist pair. (defalias 'kvfa #[(key alist receive) "\304\305 \n\"\306 @C A<\203 A\202 AC\")\"\207" [receive key alist a apply assoc append] 5 (#$ . 818)]) #@90 Retrieve the value assigned to KEY in ALIST. This uses `assoc' as the lookup mechanism. (defalias 'kva #[(key alist) "\302 \"A\207" [key alist assoc] 3 (#$ . 1132)]) #@89 Retrieve the value assigned to KEY in ALIST. This uses `assq' as the lookup mechanism. (defalias 'kvaq #[(key alist) " \236A\207" [key alist] 2 (#$ . 1306)]) #@116 Retrieve the value assigned to KEY in ALIST. This uses first the `assq' and then `assoc' as the lookup mechanism. (defalias 'kvaqc #[(key alist) " \236\206\n\302 \"A\207" [key alist assoc] 3 (#$ . 1473)]) #@131 Is the value assocd to KEY in ALIST equal to VALUE? Returns the value looked up by KEY that passes, so normally: KEY . VALUE  (defalias 'kvassoc= #[(key value alist) "\304 \"\211\205\nA \232\205\n)\207" [key alist v value assoc] 4 (#$ . 1689)]) #@25 String or symbol assoc. (defalias 'kvassoqc #[(key alist) "9\203 \202\f\302! \236\206\303 \"\206\303\304! \"\207" [key alist intern assoc symbol-name] 4 (#$ . 1950)]) #@269 Test the VALUE with the value bound to KEY in ALIST. The lookup mechanism is to ensure the key is a symbol and then use assq. Hence the name of the function being a mix of assoc and assq. Returns the value looked up by KEY that passes, so normally: KEY . VALUE  (defalias 'kvassoq= #[(key value alist) "\304 \"\211\205\nA \232\205\n)\207" [key alist v value kvassoqc] 4 (#$ . 2135)]) #@49 Test the value with KEY in ALIST matches REGEX. (defalias 'kvmatch #[(key regex alist) "\304 \"\211\205\305 \nA\"\205\n)\207" [key alist v regex kvassoqc string-match] 4 (#$ . 2537)]) #@570 Turn a simple QUERY expression into a filter function. EQUAL-FUNC is the function that implements the equality predicate. MATCH-FUNC is the function that implements the match predicate. The query language is: | a b - true if a or b is true & a b - true only if a and b is true = a b - true if a equals b as per the EQUAL-FUNC ~ a b - true if a matches b as per the MATCH-FUNC So, for example: (|(= a b)(= c d)) Means: if `a' equals `b', or if `c' equals `d' then the expression is true. (fn QUERY &key (EQUAL-FUNC \='kvassoc=) (MATCH-FUNC \='kvmatch)) (defalias 'kvquery->func #[(query &rest #1=#:--cl-rest--) "\306\307\"\206\310A@\306\311\"\206\312A@ \203B @\313>\203+ AA\211\202\314>A@\2039\315\211\202\316\317 @\"\210\202)\320\321K\322\216\321\fM\210\323\324\325\321!E!-\207" [#1# equal-func match-func #2=#:--cl-keys-- #3=#:vnew #4=#:old plist-member :equal-func (nil kvassoc=) :match-func (nil kvmatch) (:equal-func :match-func :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:equal-func :match-func)" #[(query) "@A\211\306\267\202\271\307 \310\211 :\203( @\311\f! B A\211\202 \237+B\202\272\312 \310\211:\203S@\311\f!BA\211\202:\237+B\202\272 \211G\313U\203o\211A\242\202w\314\315\316GD\"\242\317F+\202\272 \211G\313U\203\236\211A\242\202\246\314\315\320GD\"\242\317F+\202\272\310*\207" [query rest part #5=#:--cl-var-- i #6=#:--cl-var-- #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (| 12 & 47 ~ 91 = 138)) or nil query-parse and 2 signal wrong-number-of-arguments (field value) record (field value) #7=#:--cl-var-- #8=#:--cl-var-- #9=#:--cl-rest-- field value match-func #10=#:--cl-rest-- equal-func] 5] query-parse #[nil "\301M\207" [#4# query-parse] 2] eval lambda (record) query] 6 (#$ . 2734)]) #@61 Get the plist with KEYWORD / VALUE from the list of plists. (defalias 'kvplist2get #[(plist2 keyword value) "\306\307\306 :\203- @\310\n \" \232\203\"\n\306\211\202#\307\203- A\211\202 \f,\207" [plist2 #1=#:--cl-var-- plist #2=#:--cl-var-- #3=#:--cl-var-- keyword nil t plist-get value] 4 (#$ . 4646)]) #@46 Convert STR-OR-SYMBOL into a keyword symbol. (defalias 'kvthing->keyword #[(str-or-symbol) "9\203 \302!\202;\205\303 \304H\305=\203 \202\"\306 P!)\207" [str-or-symbol str symbol-name intern 0 58 ":"] 3 (#$ . 4970)]) #@30 Convert an alist to a plist. (defalias 'kvalist->plist #[(alist) "\304\211 :\203! @\305\306\n@!\nAD! \244 A\211\202 \237+\207" [alist #1=#:--cl-var-- pair #2=#:--cl-var-- nil reverse kvthing->keyword] 4 (#$ . 5205)]) #@42 Make an alist from the plist style args. (defalias 'kvacons #[(&rest args) "\301!\207" [args kvplist->alist] 2 (#$ . 5438)]) #@87 A keyword is a symbol leading with a :. Converting to a symbol means dropping the :. (defalias 'keyword->symbol #[(keyword) "\301!\203\302\303!\304\305O!\207\207" [keyword keywordp intern symbol-name 1 nil] 4 (#$ . 5570)]) #@180 Convert PLIST to an alist. The keys are expected to be :prefixed and the colons are removed unless KEYS-ARE-KEYWORDS is `t'. The keys in the resulting alist are always symbols. (defalias 'kvplist->alist #[(plist &optional keys-are-keywords) "\205=\306\211\306\211 :\203: \211\211A\242\n\211A\242\203* \202-\307 !\fB B AA\211\202 \237-\207" [plist #1=#:--cl-var-- rest key value #2=#:--cl-var-- nil keyword->symbol keys-are-keywords] 3 (#$ . 5806)]) #@48 Convert a list of alists too a list of plists. (defalias 'kvalist2->plist #[(alist2) "\304\211 :\203 @\305\306\n!C! \244 A\211\202 \237+\207" [alist2 #1=#:--cl-var-- alist #2=#:--cl-var-- nil reverse kvalist->plist] 4 (#$ . 6285)]) #@35 Get just the keys from the alist. (defalias 'kvalist->keys #[(alist) "\301\302\"\207" [alist mapcar #[(pair) "@\207" [pair] 1]] 3 (#$ . 6534)]) #@37 Get just the values from the alist. (defalias 'kvalist->values #[(alist) "\301\302\"\207" [alist mapcar #[(pair) "A\207" [pair] 1]] 3 (#$ . 6686)]) #@32 Sort ALIST (by key) with PRED. (defalias 'kvalist-sort #[(alist pred) "\301\302\"\207" [alist sort #[(a b) " @\n@\"\207" [pred a b] 3]] 3 (#$ . 6842)]) #@32 Sort ALIST by value with PRED. (defalias 'kvalist-sort-by-value #[(alist pred) "\301\302\"\207" [alist sort #[(a b) " A\nA\"\207" [pred a b] 3]] 3 (#$ . 7002)]) #@111 Return the ALIST filtered to the KEYS list. Only pairs where the car is a `member' of KEYS will be returned. (defalias 'kvalist->filter-keys #[(alist &rest keys) "\305\211 :\203 @\211@\f\235\203\n B A\211\202 \237+\207" [alist #1=#:--cl-var-- a #2=#:--cl-var-- keys nil] 3 (#$ . 7172)]) #@105 Filter the plist to just those matching KEYS. `kvalist->filter-keys' is actually used to do this work. (defalias 'kvplist->filter-keys #[(plist &rest keys) "\306\211 :\2030 @\307\n!\211\310\311O\312\232\203$\313\f\311\306O!\202%\n) B A\211\202 \237+\314\315\316\317! B\"!)\207" [keys #1=#:--cl-var-- k #2=#:--cl-var-- strkey symkeys nil symbol-name 0 1 ":" intern kvalist->plist apply kvalist->filter-keys kvplist->alist plist] 6 (#$ . 7480)]) #@60 Return the PLIST2 (a list of plists) filtered to the KEYS. (defalias 'kvplist2->filter-keys #[(plist2 &rest keys) "\305\211 :\203 @\306\307\n\fB\" B A\211\202 \237+\207" [plist2 #1=#:--cl-var-- plist #2=#:--cl-var-- keys nil apply kvplist->filter-keys] 5 (#$ . 7947)]) #@60 Return the ALIST2 (a list of alists) filtered to the KEYS. (defalias 'kvalist2->filter-keys #[(alist2 &rest keys) "\305\211 :\203 @\306\307\n\fB\" B A\211\202 \237+\207" [alist2 #1=#:--cl-var-- alist #2=#:--cl-var-- keys nil apply kvalist->filter-keys] 5 (#$ . 8233)]) #@523 Reduce the ALIST2 (a list of alists) to a single alist. CAR-KEY is the key of each alist to use as the resulting key and CDR-KEY is the key of each alist to user as the resulting cdr. For example, if CAR-KEY is `email' and CDR-KEY is `name' the records: '((user . "nic")(name . "Nic")(email . "nic@domain") (user . "jim")(name . "Jim")(email . "jim@domain")) could be reduced to: '(("nic@domain" . "Nic") ("jim@domain" . "Jic")) If PROPER is `t' then the alist is a list of proper lists, not cons cells. (defalias 'kvalist2->alist #[(alist2 car-key cdr-key &optional proper) "\306\211 :\203- @\307\f\203\310\202\311\312 \n\"\312 \n\"D\" B A\211\202 \237+\207" [alist2 #1=#:--cl-var-- alist #2=#:--cl-var-- proper car-key nil apply list cons assoc-default cdr-key] 7 (#$ . 8520)]) #@39 Convert the keys of ALIST through FN. (defalias 'kvalist-keys->* #[(alist fn) "\301\302\"\207" [alist mapcar #[(pair) " @! AB\207" [fn pair] 2]] 3 (#$ . 9339)]) #@291 Convert the keys of ALIST into symbols. If key parameter FIRST-FN is present it should be a function which will be used to first transform the string key. A popular choice might be `downcase' for example, to cause all symbol keys to be lower-case. (fn ALIST &key (FIRST-FN \='identity)) (defalias 'kvalist-keys->symbols #[(alist &rest #1=#:--cl-rest--) "\304\305\"\206\306A@\n\2037\n@\307>\203 \nAA\211\202\310>A@\203.\311\211\202\312\313\n@\"\210\202 )\314 \315\")\207" [#1# first-fn #2=#:--cl-keys-- alist plist-member :first-fn (nil identity) (:first-fn :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:first-fn)" kvalist-keys->* #[(key) "\302\303\304 \"!!\207" [first-fn key intern format "%s"] 5]] 4 (#$ . 9509)]) #@36 Filter the list of alists with FN. (defalias 'kvalist2-filter #[(alist2 fn) "\306 \306\211\n:\203#\n@ !\211\203 \fB\nA\211\202 \f\237,\207" [value alist2 #1=#:--cl-var-- rec #2=#:--cl-var-- fn nil] 3 (#$ . 10287)]) #@24 Returns a cons of A B. (defalias 'kvidentity #[(a b) " B\207" [a b] 2 (#$ . 10521)]) #@22 Given A B returns A. (defalias 'kvcar #[(a b) "\207" [a] 1 (#$ . 10613)]) #@22 Given A B returns B. (defalias 'kvcdr #[(a b) "\207" [b] 1 (#$ . 10694)]) #@104 Do a comparison of the two values using printable syntax. Use this as the function to pass to `sort'. (defalias 'kvcmp #[(a b) "\203 \302\303\"\202\f\304 \203\302\303 \"\202\304\231\207" [a b format "%S" ""] 4 (#$ . 10776)]) #@26 Do a sort using `kvcmp'. (defalias 'kvqsort #[(lst) "\301\302\"\207" [lst sort kvcmp] 3 (#$ . 11016)]) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put kvalist-key error-conditions (error) error-message "No such key found in alist."] 4) #@105 Destructively set the value of KEY to VALUE in ALIST. If the assoc is not found this adds it to alist. (defalias 'kvalist-set-value! #[(alist key value) "\304 \"\211:\203\n \241\202\305\306 D\")\207" [key alist cell value assoc signal kvalist-key] 5 (#$ . 11273)]) #@338 Use the dotted EXPR to access deeply nested data in TABLE. EXPR is a dot separated expression, either a symbol or a string. For example: "a.b.c" or: 'a.b.c If the EXPR is a symbol then the keys of the alist are also expected to be symbols. TABLE is expected to be an alist currently. FUNC is some sort of `assoc' like function. (defalias 'kvdotassoc-fn #[(expr table func) " 9\203\306\307\310\311 !\312\"\"\202\310 \312\"\3132?\n<\205>\f\n@ \"\nA\211\2034 A\202:\314\313 A\"\210)\2020*\207" [table expr parts state func traverse mapcar intern split-string symbol-name "\\." break throw] 7 (#$ . 11553)]) #@42 Dotted expression handling with `assoc'. (defalias 'kvdotassoc #[(expr table) "\302 \303#\207" [expr table kvdotassoc-fn assoc] 4 (#$ . 12188)]) #@41 Dotted expression handling with `assq'. (defalias 'kvdotassq #[(expr table) "\302 \303#\207" [expr table kvdotassoc-fn assq] 4 (#$ . 12340)]) (defalias 'kvdotassoc= #[(expr value table) "\304 \"\211\205\n \232\205\n)\207" [expr table v value kvdotassoc] 4]) (byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias dotassoc kvdotassoc dotassq kvdotassq] 3) #@66 Helper macro for `destructuring-mapcar' and `destructuring-map'. (defalias 'kv--destructuring-map '(macro . #[(map-function args sequence &rest body) "\305  \306C\307\n BBBE\fE)\207" [entry map-function args body sequence gensym lambda destructuring-bind] 7 (#$ . 12713)])) (byte-code "\300\301\302\303#\300\207" [function-put kv--destructuring-map lisp-indent-function 3] 4) #@336 A hybrid of `destructuring-bind' and `mapcar' ARGS shall be of the form used with `destructuring-bind' Unlike most other mapping forms this is a macro intended to be used for structural transformations, so the expected usage will be that ARGS describes the structure of the items in SEQ, and SEXP will describe the structure desired. (defalias 'kvmap-bind '(macro . #[(args sexp seq) "\303\304 \n\257\207" [args seq sexp kv--destructuring-map mapcar] 5 (#$ . 13099)])) (byte-code "\300\301\302\303#\304\305\301\"\207" [function-put kvmap-bind lisp-indent-function 2 defalias map-bind] 4) #@101 Merge the 2nd and subsequent plists into the first. Values set by lists to the left are clobbered. (defalias 'kvplist-merge #[(&rest plists) "@A\306\n:\203G\n@\211\306\211\306 \f:\203?\f\211 \211A \242 @\307 #\fAA\211\202,\nA\211\202 * *\207" [plists result #1=#:--cl-var-- plist #2=#:--cl-var-- key nil plist-put val #3=#:--cl-var--] 5 (#$ . 13697)]) (byte-code "\300\301!\210\300\302!\207" [provide kv dotassoc] 2)