From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Using list with append Date: Wed, 09 Nov 2022 17:19:12 +0000 Message-ID: References: <87r0yc2gyc.fsf@rub.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1834"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 09 18:20:13 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osokG-0000Gl-73 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Nov 2022 18:20:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osojo-00053K-F4; Wed, 09 Nov 2022 12:19:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osojm-00051I-Fc for help-gnu-emacs@gnu.org; Wed, 09 Nov 2022 12:19:42 -0500 Original-Received: from mail-4027.protonmail.ch ([185.70.40.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osojZ-0005eZ-KA for help-gnu-emacs@gnu.org; Wed, 09 Nov 2022 12:19:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668014365; x=1668273565; bh=U322DEEtojfDoqiy0h8fcDaW6qGXBzrXJxsm6uUibBM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=dvPRbyeMhQKhgytml8CLv+4Au0s0SxoUM5hcF1WQwQ6UadwtEGe7Kx6aBwSu8dSTB ws3cejAXfmiTxd0dEdsy/3+1VHiXhOjHSTaz7ZLK9E4yxPyGcVeKZP1S6ltaNM5TqQ lfnQamZJAlrmN+vYlGiBBnsf7bzJ8j6xmT8BMScYLkVjidAWSK6dBZyQvsC5Yi8BTL 2w73RK+VLo3Y1xJtnxy4C4WWHzBgA00tS8N3hu1ZNrhuUqzNshlXxH/4980Ft8XE4M RLyntZDswu2BNvNlwrtgzJ405mLHTBLpafqQydYbc1nouAiypDDSd2uCiAH5f7dbaN 9SoJyQIGnqOmw== In-Reply-To: <87r0yc2gyc.fsf@rub.de> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.40.27; envelope-from=heimeborgia@protonmail.com; helo=mail-4027.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140874 Archived-At: ------- Original Message ------- On Wednesday, November 9th, 2022 at 5:08 PM, Stephen Berman wrote: > On Wed, 09 Nov 2022 12:09:04 +0000 Heime heimeborgia@protonmail.com wrote= : >=20 > > This function makes a list of lists. > >=20 > > (defun pmchart selectr nc) >=20 >=20 > I assume you meant this: (defun pmchart (descr selectr nc) >=20 > > "TODO." > >=20 > > (seq-mapn > > (lambda (p q) > > (message "p: %S" p) > > (list q (append (make-list p "xxxxx") > > (make-list (- nc 1 p) "")))) > > selectr > > descr)) > >=20 > > Calling > >=20 > > (pmchart '("Peter" "Paul") [3 2] 5) > >=20 > > gives the list > >=20 > > '(("Peter" ("xxxxx" "xxxxx" "xxxxx" "")) > > ("Paul" ("xxxxx" "xxxxx" "" ""))) > >=20 > > But I want to adapt it to get this > >=20 > > '(("Peter" "xxxxx" "xxxxx" "xxxxx" "") > > ("Paul" "xxxxx" "xxxxx" "" "")) > >=20 > > Doing the following did not help > >=20 > > (list (append q (make-list p "xxxxx") (make-list (- nc 1 p) "")))) >=20 >=20 > 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): >=20 > (append (list q) (make-list p "xxxxx") (make-list (- nc 1 p) "")) >=20 > Steve Berman You are absolutely right. Thank you so very much.