help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Advantage using mapc over dolist


From: Heime
Subject: Advantage using mapc over dolist
Date: Sun, 01 Dec 2024 23:31:02 +0000

Is there any advantage using mapc over dolist when looping through
a list passed as argument to a function?

(defun marsi (actm-seqr)
  (mapc (lambda (actm)
          (pcase actm
           ('armg (do-this))
           ('go (do-that))))
         actm-seqr))

(defun marsi (actm-seqr)
  (dolist (actm actm-seqr)
    (pcase actm
      ('armg (do-this))
      ('go (do-that)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]