unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Using list with append
@ 2022-11-09 12:09 Heime
  2022-11-09 15:26 ` Emanuel Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Heime @ 2022-11-09 12:09 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


This function makes a list of lists.

(defun pmchart selectr nc)
  "TODO."
  
  (seq-mapn
     (lambda (p q)
       (message "p: %S" p)
       (list q (append (make-list p "xxxxx")
               (make-list (- nc 1 p) ""))))
       selectr
       descr))

Calling

(pmchart '("Peter" "Paul") [3 2] 5)

gives the list

'(("Peter" ("xxxxx" "xxxxx" "xxxxx" "")) 
  ("Paul" ("xxxxx" "xxxxx" "" "")))

But I want to adapt it to get this

'(("Peter" "xxxxx" "xxxxx" "xxxxx" "") 
  ("Paul" "xxxxx" "xxxxx" "" ""))

Doing the following did not help

(list (append q (make-list p "xxxxx") (make-list (- nc 1 p) ""))))





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-10 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 12:09 Using list with append Heime
2022-11-09 15:26 ` Emanuel Berg
2022-11-09 15:54 ` [External] : " Drew Adams
2022-11-10 18:02   ` Emanuel Berg
2022-11-09 17:08 ` Stephen Berman
2022-11-09 17:19   ` Heime
2022-11-10 14:21 ` Jean Louis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).