unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Using list with append
Date: Thu, 10 Nov 2022 17:21:31 +0300	[thread overview]
Message-ID: <Y20I6x7Cr2oWLzQ0@protected.localdomain> (raw)
In-Reply-To: <Ev9QUHHi_PsW5YdHdgDB3zDy1fEohlkoSXToWHeQgZ_lQnoYfCVaGUwYGuUF46TzXFSkyoTnPwdKtTAggqQtIkfW9t8K3-GmbkQ1dSBRWCU=@protonmail.com>

* 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/



      parent reply	other threads:[~2022-11-10 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y20I6x7Cr2oWLzQ0@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).