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

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

Re: Using list with append


From: Jean Louis
Subject: Re: Using list with append
Date: Thu, 10 Nov 2022 17:21:31 +0300
User-agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02)

* Heime <heimeborgia@protonmail.com> [2022-11-09 15:11]:
> 
> This function makes a list of lists.
> 
>

I see function below is not correct, so I do not know how you got it to work:

;; (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)

As it should be formatted this way:

(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

The function below is wrong, you are providing 3 arguments, but expecting 2:

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

So I do not know how you make it work. Please provide first workable function:

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" "" ""))

"Peter" shall be in the (list

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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