Elisp: Foreach (Side-Effect)
Foreach (Side-Effect, Do Not Care Result)
mapc
-
(mapc FUNCTION SEQUENCE)
- Apply function to each element of Sequence
- Return SEQUENCE unchanged.
(mapc (lambda (x) (insert (number-to-string x))) (number-sequence 1 9)) ;; insert 123456789
;; apply a file function to a list of files (mapc 'my-update-footer (list "~/x1.html" "~/x2.html" "~/x3.html"))
seq-do
(aliasseq-each
)-
Loop a function over the sequence. (similar to
mapc
) seq-doseq
-
(seq-doseq (VAR SEQUENCE) BODY)
loop a variable over the sequence. (similar to
dolist
.)(setq xx [1 2 3] ) (seq-doseq (x xx) (message "x is %s" x)) ;; return the original sequence [1 2 3]
Elisp, sequence functions
- Elisp: Sequence Type
- Elisp: Sequence Functions
- Elisp: Sequence, Take, Drop, Slice
- Elisp: Map to Sequence
- Elisp: Foreach (Side-Effect)
- Elisp: Sequence Iteration, Conditional Exit
- Elisp: Sequence Filter
- Elisp: Sequence Map Insert
- Elisp: Sequence Iteration
- Elisp: Sequence Find
- Elisp: Sequence, Sort, Reverse
- Elisp: Sequence Join, Convert
- Elisp: Sequence Union, Intersection, Difference
- Elisp: More Sequence Functions
- Elisp: Destructure Binding (seq-setq, seq-let)