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

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

Looping lists through mapcar


From: uzibalqa
Subject: Looping lists through mapcar
Date: Tue, 23 Aug 2022 12:16:56 +0000

I would like to pass a number of alists in the form assoc-table-N so that I can 
store data
in another list named `nscrip'.   Would like to manage the lists without having 
to list them
individually.  My idea has been to use mapcar, but the scheme has not worked 
out, and the lists
are net being passed through the loop.


(dolist (aggr (list (mapcar #'construct-assoc-table
                            (number-sequence 1 8))))
  (setq rplc (cdr (assoc word aggr)))
  (unless (null rplc)
     (add-to-list 'nscrip
         (replace-regexp-in-string word rplc word))))


(defun construct-assoc-table (n)
  "Return value of symbol `assoc-table-N', an alist of
paired string elements."

  (symbol-value (intern (format "assoc-table-%d" n))))



reply via email to

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