
(provide (quote baw-alist))

(defun asort (alist-symbol key) "\
Move a specified key-value pair to the head of an alist.
The alist is referenced by ALIST-SYMBOL. Key-value pair to move to
head is one matching KEY.  Returns the sorted list and doesn't affect
the order of any other key-value pair.  Side effect sets alist to new
sorted list." (byte-code "ÁÂÃ!!Ä\"L‡" [alist-symbol sort copy-alist eval (lambda (a b) (byte-code "Â@	\"‡" [a key equal] 3))] 6))

(defun aelement (key value) "\
Makes a list of a cons cell containing car of KEY and cdr of VALUE.
The returned list is suitable as an element of an alist." (byte-code "	BC‡" [key value] 2))

(defun aheadsym (alist) "\
Return the key symbol at the head of ALIST." (byte-code "@@‡" [alist] 1))

(defun anot-head-p (alist key) "\
Find out if a specified key-value pair is not at the head of an alist.
The alist to check is specified by ALIST and the key-value pair is the
one matching the supplied KEY.  Returns nil if ALIST is nil, or if
key-value pair is at the head of the alist.  Returns t if key-value
pair is not at the head of alist.  ALIST is not altered." (byte-code "ÂÃ!	\"?‡" [alist key equal aheadsym] 4))

(defun aput (alist-symbol key &optional value) "\
Inserts a key-value pair into an alist.
The alist is referenced by ALIST-SYMBOL. The key-value pair is made
from KEY and optionally, VALUE. Returns the altered alist or nil if
ALIST is nil.

If the key-value pair referenced by KEY can be found in the alist, and
VALUE is supplied non-nil, then the value of KEY will be set to VALUE.
If VALUE is not supplied, or is nil, the key-value pair will not be
modified, but will be moved to the head of the alist. If the key-value
pair cannot be found in the alist, it will be inserted into the head
of the alist (with value nil if VALUE is nil or not supplied)." (byte-code "Æ	
\"ÇÈ	\"ˆÉ!‰ˆ?ƒ L‚: Ê	\"ƒ- Ë\"L‚: 
ƒ9 Ì@\"‚: *‡" [elem key value alist alist-symbol t aelement nil asort eval anot-head-p nconc setcar] 8))

(defun adelete (alist-symbol key) "\
Delete a key-value pair from the alist.
Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
is pair matching KEY.  Returns the altered alist." (byte-code "Å	\"ˆÆ!
?ƒ Ã‚! Ç
	\"ƒ 
‚! 
AL)‡" [alist-symbol key alist nil t asort eval anot-head-p] 5))

(defun aget (alist key &optional keynil-p) "\
Returns the value in ALIST that is associated with KEY.
Optional KEYNIL-P describes what to do if the value associated with
KEY is nil.  If KEYNIL-P is not supplied or is nil, and the value is
nil, then KEY is returned.  If KEYNIL-P is non-nil, then nil would be
returned.

If no key-value pair matching KEY could be found in ALIST, or ALIST is
nil then nil is returned. ALIST is not altered." (byte-code "Æ	!	?ƒ Â‚2 ÇÀ\"ˆÈ\"ƒ Â‚2 @A†2 ƒ+ Â‚2 @@†2 Â)‡" [copy alist nil key keynil-p t copy-alist asort anot-head-p] 5))

(defun amake (alist-symbol keylist &optional valuelist) "\
Make an association list.
The association list is attached to the alist referenced by
ALIST-SYMBOL. Each element in the KEYLIST becomes a key and is
associated with the value in VALUELIST with the same index. If
VALUELIST is not supplied or is nil, then each key in KEYLIST is
associated with nil.

KEYLIST and VALUELIST should have the same number of elements, but
this isn't enforced.  If VALUELIST is smaller than KEYLIST, remaining
keys are associated with nil.  If VALUELIST is larger than KEYLIST,
extra values are ignored.  Returns the created alist." (byte-code "	@	A@A
?ƒ È#‚' É
#ˆÈ#,ˆÊ!‡" [keycar keylist keycdr valcar valuelist valcdr alist-symbol t aput amake eval] 6))
