%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/share/emacs/27.2/lisp/emacs-lisp/
Upload File :
Create Path :
Current File : //usr/local/share/emacs/27.2/lisp/emacs-lisp/let-alist.elc

;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@192 Return alist of symbols inside DATA that start with a `.'.
Perform a deep search and return an alist where each car is the
symbol, and each cdr is the same symbol without the `.'.

(fn DATA)
(defalias 'let-alist--deep-dot-search #[257 "\2119\203\300!\301\302\"\205\303\304\305\306\211$!BC\207\307!\203*\310\311\312\313\"\"\207\211:\2041\306\207\211@\314=\203>\313A@!\207\315\313@!\313A!\"\207" [symbol-name string-match "\\`\\." intern replace-match "" nil vectorp apply nconc mapcar let-alist--deep-dot-search let-alist append] 9 (#$ . 409)])
#@76 Return a sexp used to access SYMBOL inside VARIABLE.

(fn SYMBOL VARIABLE)
(defalias 'let-alist--access-sexp #[514 "\300!\301!\302\303\"\203\202\304\305\306\307\310\"\237\"\"\207" [let-alist--remove-dot symbol-name string-match "\\`\\." let-alist--list-to-sexp mapcar intern split-string "\\."] 10 (#$ . 976)])
#@79 Turn symbols LIST into recursive calls to `cdr' `assq' on VAR.

(fn LIST VAR)
(defalias 'let-alist--list-to-sexp #[514 "\300\301\302@DA\203\303A\"\202ED\207" [cdr assq quote let-alist--list-to-sexp] 8 (#$ . 1303)])
#@50 Return SYMBOL, sans an initial dot.

(fn SYMBOL)
(defalias 'let-alist--remove-dot #[257 "\300!\301\302\"\203\303\304\305\306\211$!\202\207" [symbol-name string-match "\\`\\." intern replace-match "" nil] 8 (#$ . 1533)])
#@886 Let-bind dotted symbols to their cdrs in ALIST and execute BODY.
Dotted symbol is any symbol starting with a `.'.  Only those present
in BODY are let-bound and this search is done at compile time.

For instance, the following code

  (let-alist alist
    (if (and .title .body)
        .body
      .site
      .site.contents))

essentially expands to

  (let ((.title (cdr (assq \='title alist)))
        (.body  (cdr (assq \='body alist)))
        (.site  (cdr (assq \='site alist)))
        (.site.contents (cdr (assq \='contents (cdr (assq \='site alist))))))
    (if (and .title .body)
        .body
      .site
      .site.contents))

If you nest `let-alist' invocations, the inner one can't access
the variables of the outer one. You can, however, access alists
inside the original alist by using dots inside the symbol, as
displayed in the example above.

(fn ALIST &rest BODY)
(defalias 'let-alist '(macro . #[385 "\300\301!\302DC\302\303\304\305\306\307\310	!\311\"\312\313%\314\315!!\"BBE\207" [make-symbol "alist" let mapcar make-byte-code 257 "\211@\301@\300\"D\207" vconcat vector [let-alist--access-sexp] 5 "\n\n(fn X)" delete-dups let-alist--deep-dot-search] 13 (#$ . 1768)]))
(byte-code "\300\301\302\303#\304\301\305\306#\210\307\301!\207" [function-put let-alist lisp-indent-function 1 put edebug-form-spec t provide] 5)

Zerion Mini Shell 1.0