all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Using list with append
Date: Wed, 09 Nov 2022 17:19:12 +0000	[thread overview]
Message-ID: <k8ZnVXiau73SjH7rnsG4C1oJ4ZJYuAulhuXbAMLfGif6VPMlhiFVFSJCZgBt_Ql8RppIsXHw_JCcXXf7OdH5Y9fbxxUUtrQd85e53hgk64g=@protonmail.com> (raw)
In-Reply-To: <87r0yc2gyc.fsf@rub.de>

------- Original Message -------
On Wednesday, November 9th, 2022 at 5:08 PM, Stephen Berman <stephen.berman@gmx.net> wrote:


> On Wed, 09 Nov 2022 12:09:04 +0000 Heime heimeborgia@protonmail.com wrote:
> 
> > This function makes a list of lists.
> > 
> > (defun pmchart selectr nc)
> 
> 
> I assume you meant this: (defun pmchart (descr 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) ""))))
> 
> 
> You want to append the list of x's to the list containing the name, not
> to the name (which is a sequence of characters, so appending to it would
> make a list beginning with the numerical values of the characters of the
> name):
> 
> (append (list q) (make-list p "xxxxx") (make-list (- nc 1 p) ""))
> 
> Steve Berman

You are absolutely right.  Thank you so very much.




  reply	other threads:[~2022-11-09 17:19 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 [this message]
2022-11-10 14:21 ` Jean Louis

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

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

  git send-email \
    --in-reply-to='k8ZnVXiau73SjH7rnsG4C1oJ4ZJYuAulhuXbAMLfGif6VPMlhiFVFSJCZgBt_Ql8RppIsXHw_JCcXXf7OdH5Y9fbxxUUtrQd85e53hgk64g=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stephen.berman@gmx.net \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.