;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'seq) #@65 Symbol internally used to streams whose head was not evaluated. (defconst stream--fresh-identifier '--stream-fresh-- (#$ . 423)) #@61 Symbol internally used to streams whose head was evaluated. (defconst stream--evald-identifier '--stream-evald-- (#$ . 558)) #@117 Return a stream built from BODY. BODY must return nil or a cons cell whose cdr is itself a stream. (fn &rest BODY) (defalias 'stream-make '(macro . #[128 "\301\302D\303\304BBE\207" [stream--fresh-identifier cons quote lambda nil] 6 (#$ . 690)])) (put 'stream-make 'edebug-form-spec t) #@112 Evaluate and return the first cons cell of STREAM. That value is the one passed to `stream-make'. (fn STREAM) (defalias 'stream--force #[257 "\211\242=\203\n\211A\207\211\242 =\203 \211\211A \241\262\211\240\266\207\302\303\304D\"\207" [stream--evald-identifier stream--fresh-identifier signal wrong-type-argument streamp] 5 (#$ . 985)]) #@129 Return a stream built from the cons of FIRST and REST. FIRST and REST are forms and REST must return a stream. (fn FIRST REST) (defalias 'stream-cons '(macro . #[514 "\300\301ED\207" [stream-make cons] 6 (#$ . 1340)])) (byte-code "\300\301\302\303#\210\304\305\306\305\307\310#\311#\210\312\305\310\313\310\314%\210\312\305\310\315\310\316%\210\312\305\310\317\310\320%\207" [put stream-cons edebug-form-spec t defalias stream cl-generic-define (src) nil "Return a new stream from SRC.\n\n(fn SRC)" cl-generic-define-method ((seq sequence)) #[257 "\300!\203 \301 \207\302\303\304\305\306\307!\310\"\311$B\207" [seq-empty-p stream-empty --stream-fresh-- make-byte-code 0 "\301\300\302\"\303\304\300\305\"!B\207" vconcat vector [seq-elt 0 stream seq-subseq 1] 5] 8 "Return a stream built from the sequence SEQ.\nSEQ can be a list, vector or string.\n\n(fn SEQ)"] ((list list)) #[257 "\211\204\300 \207\301\302\303\304\305\306!\307\"\310$B\207" [stream-empty --stream-fresh-- make-byte-code 0 "\300@\301\300A!B\207" vconcat vector [stream] 3] 8 "Return a stream built from the list LIST.\n\n(fn LIST)"] ((buffer buffer) &optional pos) #[513 "\211Crq\210\211\242\204\211e\240\210\211\242dY\203\300 \210\301\302\303\304\305\306\"\307\"\310$)B\207" [stream-empty --stream-fresh-- make-byte-code 0 "r\300q\210\212\214~\210\301\242b\210`f+\302\300\301\242T\"B\207" vconcat vector [stream] 4] 11 "Return a stream of the characters of the buffer BUFFER.\nBUFFER may be a buffer or a string (buffer name).\nThe sequence starts at POS if non-nil, `point-min' otherwise.\n\n(fn BUFFER &optional POS)"]] 6) #@142 Return a stream generating new elements through ITERATOR. ITERATOR is an iterator object in terms of the "generator" package. (fn ITERATOR) (defalias 'stream-from-iterator #[257 "\300\301\302\303\304\305!\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\3011 \302\300!\303\300!B0\207\210\304\207" vconcat vector [(iter-end-of-sequence) iter-next stream-from-iterator nil] 3] 8 (#$ . 2960)]) #@22 (fn BUFFER REGEXP) (defalias 'stream-regexp #[514 "\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302r\300q\210\303\301\302\304#\262)\211\205\305 \306\300\301\"B\207" vconcat vector [nil re-search-forward t match-data stream-regexp] 5] 10 (#$ . 3366)]) #@251 Return a stream of the integers from START to END, stepping by STEP. If START is nil, it defaults to 0. If STEP is nil, it defaults to 1. START is inclusive and END is exclusive. If END is nil, the range is infinite. (fn &optional START END STEP) (defalias 'stream-range #[768 "\211CC\211\242\204 \211\300\240\210\242\204\301\240\210\211\242\232\203\"\302 \2024\303\304\300\305\306\307\n #\310\"\311$B\207" [0 1 stream-empty --stream-fresh-- make-byte-code "\300\242\303\300\242\302\242\\\301\302\242#B\207" vconcat vector [stream-range] 5] 14 (#$ . 3669)]) #@67 Return non-nil if STREAM is a stream, nil otherwise. (fn STREAM) (defalias 'streamp #[257 "\211\242\211=\206 \211 =\207" [stream--fresh-identifier stream--evald-identifier] 4 (#$ . 4249)]) #@19 The empty stream. (defconst stream-empty (cons stream--evald-identifier nil) (#$ . 4447)) #@26 Return the empty stream. (defalias 'stream-empty #[0 "\207" [stream-empty] 1 (#$ . 4543)]) #@64 Return non-nil if STREAM is empty, nil otherwise. (fn STREAM) (defalias 'stream-empty-p #[257 "\300!A?\207" [stream--force] 3 (#$ . 4641)]) #@81 Return the first element of STREAM. Return nil if STREAM is empty. (fn STREAM) (defalias 'stream-first #[257 "\300!@\207" [stream--force] 3 (#$ . 4789)]) #@70 Return a stream of all but the first element of STREAM. (fn STREAM) (defalias 'stream-rest #[257 "\300!A\206 \301 \207" [stream--force stream-empty] 3 (#$ . 4951)]) #@143 Concatenate the STREAMS. Requesting elements from the resulting stream will request the elements in the STREAMS in order. (fn &rest STREAMS) (defalias 'stream-append #[128 "\211C\211\242\204\f\300 \202\301\302\303\304\305\306!\307\"\310$B\207" [stream-empty --stream-fresh-- make-byte-code 0 "\300\242\300\211\242A\240\210\242\301!\203\"\300\242\203\"\300\242\300\211\242A\240\210\242\262\202 \301!?\205@\302!\300\242\203<\303\304\305!\300\242#\202?\305!B\207" vconcat vector [stream-empty-p stream-first apply stream-append stream-rest] 6] 9 (#$ . 5126)]) #@90 Return the first element of STREAM and set the value of STREAM to its rest. (fn STREAM) (defalias 'stream-pop '(macro . #[257 "\2119\204 \300\301!\210\302\303D\304\305DEE\207" [error "STREAM must be a symbol" prog1 stream-first setq stream-rest] 7 (#$ . 5707)])) (defconst stream--generalizer (byte-code "\300\301\302\303\304\305%\207" [#[385 "\300\301D\302BB\207" [when streamp ('stream)] 5 "\n\n(fn NAME &rest _)"] #[385 "\300=\205\301\207" [stream (stream)] 4 "\n\n(fn TAG &rest _)"] record cl--generic-generalizer stream--generalizer 11] 8)) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\210\300\310\302\311\302\312%\210\300\313\302\314\302\315%\210\300\316\302\317\302\320%\210\300\321\302\322\302\323%\210\300\324\302\325\302\326%\210\300\327\302\330\302\331%\210\300\327\302\332\302\333%\210\300\327\302\334\302\335%\210\300\336\302\337\302\340%\210\300\341\302\342\302\343%\210\300\344\302\345\302\346%\210\300\347\302\350\302\351%\210\300\352\302\353\302\354%\210\300\355\302\356\357\360%\210\300\361\302\362\302\363%\210\300\364\302\365\302\366%\207" [cl-generic-define-method cl-generic-generalizers nil ((_specializer (eql stream))) #[257 "C\207" [stream--generalizer] 2 "Support for `stream' specializers.\n\n(fn SPECIALIZER)"] seqp ((_stream stream)) #[257 "\300\207" [t] 2 "\n\n(fn STREAM)"] seq-empty-p ((stream stream)) #[257 "\300!\207" [stream-empty-p] 3 "\n\n(fn STREAM)"] seq-elt ((stream stream) n) #[514 "\211\300V\203\301!\262\211S\262\202\302!\207" [0 stream-rest stream-first] 4 "Return the element of STREAM at index N.\n\n(fn STREAM N)"] seq-length ((stream stream)) #[257 "\300\301!\204\211T\262\302!\262\202\211\207" [0 stream-empty-p stream-rest] 4 "Return the length of STREAM.\nThis function will eagerly consume the entire stream.\n\n(fn STREAM)"] seq-subseq ((stream stream) start &optional end) #[770 "\300W\204\211\203\211\300W\203\301\302!\210\303\"\203%\304Z\"\202&\211\207" [0 error "seq-subseq: only non-negative indexes allowed for streams" seq-drop seq-take] 8 "Return a stream of elements of STREAM from START to END.\n\nEND is exclusive. If END is omitted, include all elements from\nSTART on. Both START and END must be non-negative. Since\nstreams are a delayed type of sequences, don't signal an error if\nSTART or END are larger than the number of elements (the returned\nstream will simply be accordingly shorter, or even empty).\n\n(fn STREAM START &optional END)"] seq-into-sequence ((stream stream)) #[257 "\300C\301\302\303\304\305\306!\307\"\310\311%\"\210\211\242\237\207" [nil seq-do make-byte-code 257 "\300\300\242B\240\207" vconcat vector #1=[] 4 "\n\n(fn ELT)"] 9 "Convert STREAM into a sequence.\n\n(fn STREAM)"] seq-into ((stream stream) type) #[514 "\300\301!\"\207" [seq-into seq-into-sequence] 5 "Convert STREAM into a sequence of type TYPE.\n\n(fn STREAM TYPE)"] ((stream stream) (_type (eql stream))) #[514 "\207" #1# 3 "\n\n(fn STREAM TYPE)"] ((seq sequence) (_type (eql stream))) #[514 "\300!\207" [stream] 4 "\n\n(fn SEQ TYPE)"] seq-take ((stream stream) n) #[514 "\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\301\302U\206 \303\300!?\205\304\300!\305\306\300!\301S\"B\207" vconcat vector [0 stream-empty-p stream-first seq-take stream-rest] 4] 10 "Return a stream of the first N elements of STREAM.\n\n(fn STREAM N)"] seq-drop ((stream stream) n) #[514 "\211CC\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302\300\242!\204\301\242\303U\204\301\211\242S\240\210\300\304\300\242!\240\210\202\302\300\242!?\205/\305\300\242!\304\300\242!B\207" vconcat vector [stream-empty-p 0 stream-rest stream-first] 3] 12 "Return a stream of STREAM without its first N elements.\n\n(fn STREAM N)"] seq-take-while (pred (stream stream)) #[514 "\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\300\302\301!!\205\302\301!\303\300\304\301!\"B\207" vconcat vector [stream-first seq-take-while stream-rest] 5] 10 "Return a stream of the successive elements for which (PRED elt) is non-nil in STREAM.\n\n(fn PRED STREAM)"] seq-drop-while (pred (stream stream)) #[514 "\211C\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302\301\242!\204\300\303\301\242!!\204\301\304\301\242!\240\210\202\302\301\242!?\205+\303\301\242!\304\301\242!B\207" vconcat vector [stream-empty-p stream-first stream-rest] 3] 11 "Return a stream from the first element for which (PRED elt) is nil in STREAM.\n\n(fn PRED STREAM)"] seq-map #'(stream stream) #[514 "\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302\301!?\205\300\303\301!!\304\300\305\301!\"B\207" vconcat vector [stream-empty-p stream-first seq-map stream-rest] 5] 10 "Return a stream representing the mapping of FUNCTION over STREAM.\nThe elements of the produced stream are the results of the\napplications of FUNCTION on each element of STREAM in succession.\n\n(fn FUNCTION STREAM)"] seq-mapn (function (stream stream) &rest streams) t #[899 "\300\301\"\204\n \207\302C\211\303\304\305\306\307!\310\"\311\312%\240\210\211\242B\"\207" [seq-every-p streamp nil make-byte-code 514 "\301\302\303\304\305\306\300#\307\"\310$B\207" vconcat vector [--stream-fresh-- make-byte-code 0 "\303\304\302\"?\205\305\301\306\307\302\"\"\300\242\301\306\310\302\"\"B\207" vconcat vector [seq-some stream-empty-p apply mapcar stream-first stream-rest] 6] 11 "\n\n(fn F STREAMS)"] 12 "Map FUNCTION over the STREAMS.\n\nExample: this prints the first ten Fibonacci numbers:\n\n (letrec ((fibs (stream-cons\n 1\n (stream-cons\n 1\n (seq-mapn #'+ fibs (stream-rest fibs))))))\n (seq-do #'print (seq-take fibs 10)))\n\n(fn FUNCTION STREAMS...)"] seq-do #'(stream stream) #[514 "\300!?\205\301!!\210\302!\262\202\207" [stream-empty-p stream-first stream-rest] 5 "Evaluate FUNCTION for each element of STREAM eagerly, and return nil.\n\n`seq-do' should never be used on infinite streams without some\nkind of nonlocal exit.\n\n(fn FUNCTION STREAM)"] seq-filter (pred (stream stream)) #[514 "\211C\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302\301\242!\204\300\303\301\242!!\204\301\304\301\242!\240\210\202\302\301\242!?\205.\303\301\242!\305\300\304\301\242!\"B\207" vconcat vector [stream-empty-p stream-first stream-rest seq-filter] 5] 11 "Return a stream of the elements for which (PRED element) is non-nil in STREAM.\n\n(fn PRED STREAM)"]] 6) #@280 Return a new stream to be obtained by evaluating EXPR. EXPR will be evaluated once when an element of the resulting stream is requested for the first time, and must return a stream. EXPR will be evaluated in the lexical environment present when calling this function. (fn EXPR) (defalias 'stream-delay '(macro . #[257 "\300\301!\302\303DC\304\305D\306\307\310D\311 DEFED\207" [make-symbol "stream" stream-make let if stream-empty-p nil cons stream-first stream-rest] 12 (#$ . 12363)])) (cl-generic-define-method 'seq-copy nil '((stream stream)) nil #[257 "\300\301\302\303\304\305!\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\300\301!?\205\302!\303!B\207" vconcat vector [stream-empty-p stream-first stream-rest] 4] 8 "Return a shallow copy of STREAM.\n\n(fn STREAM)"]) #@402 Return a stream of successive reduced values for STREAM. If the elements of a stream s are s_1, s_2, ..., the elements S_1, S_2, ... of the stream returned by (stream-scan f init s) are defined recursively by S_1 = init S_(n+1) = (funcall f S_n s_n) as long as s_n exists. Example: (stream-scan #\='* 1 (stream-range 1)) returns a stream of the factorials. (fn FUNCTION INIT STREAM) (defalias 'stream-scan #[771 "C\300\301\302\303\304\305 #\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\302\242\303\304\305\306\307\310\300\302\"\311\"\312\313%\301\"B\207" vconcat vector [seq-map make-byte-code 257 "\301\300\301\242\"\240\207" vconcat vector [] 5 "\n\n(fn EL)"] 9] 13 (#$ . 13164)]) #@79 Request all elements from STREAM in order for side effects only. (fn STREAM) (defalias 'stream-flush #[257 "\300!?\205\301!\262\202\207" [stream-empty-p stream-rest] 3 (#$ . 13887)]) #@208 Return a stream of repeated applications of FUNCTION to VALUE. The returned stream starts with VALUE. Any successive element will be found by calling FUNCTION on the preceding element. (fn FUNCTION VALUE) (defalias 'stream-iterate-function #[514 "\300\301\302\303\304\305\"\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\301\302\300\211\301!\"B\207" vconcat vector [stream-iterate-function] 5] 10 (#$ . 14085)]) #@169 Concatenate all streams in STREAM-OF-STREAMS and return the result. All elements in STREAM-OF-STREAMS must be streams. The result is a stream. (fn STREAM-OF-STREAMS) (defalias 'stream-concatenate #[257 "\211C\300\301\302\303\304\305!\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\301\300\242!\204\301\302\300\242!!\203\300\303\300\242!\240\210\202\301\300\242!?\2058\302\211\300\242!!\304\305\306\307\310\311\312\300!\313\"\314$B!B\207" vconcat vector [stream-empty-p stream-first stream-rest stream-concatenate --stream-fresh-- make-byte-code 0 "\301\302\300\242!!\301\300\242!B\207" vconcat vector [stream-rest stream-first] 3] 9] 9 (#$ . 14517)]) #@95 Helper for `stream-of-directory-files'. (fn DIRECTORY &optional NOSORT RECURSE FOLLOW-LINKS) (defalias 'stream-of-directory-files-1 #[1025 "\300\301\302\303\304\305    $\306\"\307$B\207" [--stream-fresh-- make-byte-code 0 "\304\300!\203\202\305\211\301\203\306\202\307\310\300\311\305\301$\211\203_\211@\312!\211\203.\313\314!!\315\235\204WB\262\211\203W\303\204B\316!\204W\317\302!\203N\302!\202O\302\203WB\262\210A\266\202\202\210\320\321\322!!\323\324\325\326\327\330\301\302\303#\331\"\332\333%!\"#\266\203\202\204\334 \335!?\205\222\336!\337!B\207" vconcat vector [file-accessible-directory-p nil identity nreverse directory-files t file-directory-p file-name-nondirectory directory-file-name ("." "..") file-symlink-p functionp apply stream-append stream mapcar make-byte-code 257 "\303\300\301\302$\207" vconcat vector [stream-of-directory-files-1] 6 "\n\n(fn DIR)" stream-empty stream-empty-p stream-first stream-rest] 15] 14 (#$ . 15192)]) #@943 Return a stream of names of files in DIRECTORY. Call `directory-files' to list file names in DIRECTORY and make the result a stream. Don't include files named "." or "..". The arguments FULL and NOSORT are directly passed to `directory-files'. Third optional argument RECURSE non-nil means recurse on subdirectories. If RECURSE is a function, it should be a predicate accepting one argument, an absolute file name of a directory, and return non-nil when the returned stream should recurse into that directory. Any other non-nil value means recurse into every readable subdirectory. Even with recurse non-nil, don't descent into directories by following symlinks unless FOLLOW-LINKS is non-nil. If FILTER is non-nil, it should be a predicate accepting one argument, an absolute file name. It is used to limit the resulting stream to the files fulfilling this predicate. (fn DIRECTORY &optional FULL NOSORT RECURSE FOLLOW-LINKS FILTER) (defalias 'stream-of-directory-files #[1537 "\300$\203\301\"\202\211\203\211\202,\302\303\304\305\306\307 !\310\"\311\312%\"\207" [stream-of-directory-files-1 seq-filter seq-map make-byte-code 257 "\301\300\"\207" vconcat vector [file-relative-name] 4 "\n\n(fn FILE)"] 15 (#$ . 16193)]) (provide 'stream)