From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pietru@caramail.com Newsgroups: gmane.emacs.help Subject: Re: Passing a list to an interactive function Date: Sat, 19 Dec 2020 04:34:01 +0100 Message-ID: References: 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="12104"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 19 04:35:17 2020 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 1kqT1Z-00032v-I6 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 04:35:17 +0100 Original-Received: from localhost ([::1]:47770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqT1Y-0004JY-GM for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 22:35:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqT0u-0004JQ-JS for help-gnu-emacs@gnu.org; Fri, 18 Dec 2020 22:34:36 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:53091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqT0s-000491-Pr for help-gnu-emacs@gnu.org; Fri, 18 Dec 2020 22:34:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608348842; bh=OWp5o8NglJU4x18Ia/fahkjajlpByo48YbkBGjZ2CNk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MppqPj2Bk0uPfdudjn52C4srm06Zf27EPCoKHJmnfxaaz8BNkgvXrwQiqlg3o9mZT TVh/70+icvxlkB0tAHdMAmH/iuwm0WcQrsMqcwWBScEHik1ukt1xFSIXlB7OubbDr1 wzadzs6VBptydAF5IPpvNOUpYh4pjP0yQyJsmIF0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs02.server.lan [172.19.170.129]) (via HTTP); Sat, 19 Dec 2020 04:34:01 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:NVDmi+vgLbt1BPge9MpZkv382wiy+BG0FsMmYjzmOLd1Ogwx/nFPFes3yAgcIoQ1BNRTA XfjHXN3orB2v69gC7GQy/tLBFBmOnoZBXU03Elv/13K5GrfhMZ3aHnPO+TNYU/HB39dJbM64Eqr1 XMf8xJOdK3fU/6G/VmgVx55kCcdelZwU5JaHWVYZBM59fMaps0z2TbqbiT1rEVFfzWA7z+6LANQu hpj9a+YjR1CYcl/YTn1X+0M5p9rX8rSQoBezgeJF5GFGh5uv22tYv7OnPoZtV+KLbyC3Zo/CslpK FQ= X-UI-Out-Filterresults: notjunk:1;V03:K0:tn2jqeqdN3Y=:oH06aJ5ZtvDBEJUTxUQFM6 HYxqrBHjLRxABFNbmzZ2HJgtDXSNAt8BDcUHLzwfT9c2wLPt3csuVh8YO4wd+Rgwlc6NJqVoy QjFQuEAOwFdUvsiw41RpQKNpMcKHXke9c2qX6/j5DLVBxn+RW0a6avKu7xTpPVYYdb2q33HcY zM7mnzlorpVGiu+FAW7SzyL+8pjapNTYB6iTr8VOUx3L7Vpirae9gH/3dqedDqFpY6aPMJMWu dtz53zfXp9m8M7L0RxudKuuuM+7Ez8av8AqeZ0Lwe8uwbqdaKubobgNxJ2+UIwbBROABJWQyA Du0yO0PAuX3BM7R54UVQATw4H83D5SiCu/YgWXMCTNfs6qoZFrNSPXnFbiChWlvCxJXrLLkH/ 45GrpOlFT3p9LME4uwwa6yT4jiTHUuUa37pPKPudTKlMUj23/dVuILlu6cRO4yac7ijLxbP3k TbnVPYZWo/TAmfc8qyabw0Qu7SkLlTcKV27KEmUNX2AgafpcNhoax1FGZX4tHLipV+Z2krCPl GKCMEBW7aBLpx468QkA16W4lKcdbzsYstIHiP48RmfUWXLQT5duSs+xBr3YXxEbPWFHtccEa0 7yBCVMQ9jm3vU= Received-SPF: pass client-ip=212.227.15.18; envelope-from=pietru@caramail.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 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" Xref: news.gmane.io gmane.emacs.help:126553 Archived-At: I decided towards a simpler strategy by passing a string with numbers separated by spaces. But inside the function, I got to convert from string to a list containing numbers. How could I convert to a list containing numbers. Example of string: "3 5 13" > Sent: Saturday, December 19, 2020 at 4:25 AM > From: "Jean Louis" > To: pietru@caramail.com > Cc: "Help Gnu Emacs" > Subject: Re: Passing a list to an interactive function > > * pietru@caramail.com [2020-12-19 05:06]: > > Still very unsure what to do. I want to call "M-x thermoluminescence" > > but pass six numbers to the function. > > > > (defun thermoluminesce (ta tb tlab tc td tlcd te tf tlef) > > (interactive) ) > > > > Could I simply pass six numbers separated by spaces > > To make it less error prone, just do this: > > (defun thermoluminesce () > (interactive) > (let* ((list '()) ;; here you prepare empty list > (list (dotimes (n 6 (reverse list)) > (push (read-number (format "Enter number %s: " (1+ n))) list))) > (ta (elt list 0)) > (tb (elt list 1)) > (tlab (elt list 2)) > (tc (elt list 3)) > (td (elt list 4)) > (tlcd (elt list 5)) > (te (elt list 6))) > ;; continue here using variables > )) >