From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: steve-humphreys@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Understanding the "let" construct and the setting of variables Date: Thu, 17 Dec 2020 01:25:11 +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="20439"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: steve-humphreys@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 17 01:25:49 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 1kph77-0005CB-B6 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 01:25:49 +0100 Original-Received: from localhost ([::1]:57056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kph76-00025H-9E for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Dec 2020 19:25:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kph6b-00023n-BX for help-gnu-emacs@gnu.org; Wed, 16 Dec 2020 19:25:17 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:51483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kph6X-0004Jk-V0 for help-gnu-emacs@gnu.org; Wed, 16 Dec 2020 19:25:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608164711; bh=L8F29F0o6+s/ZANOqlwX1R9TurUfR0Ny2DeiFF5sn+s=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VtuRa2y/XMu/P5C6zo08chfKB/DxWpZAZ8RlqU/ULxWnreYtFc9j8zsPmmpGQfMQf EiEIDqzXA6y0aFWEF1wzZEi0T0RR9lQKU0gA+/yW2VJIXcg5I1XzCT38BHwis8ZF8F gDYj/2H8zDQbb8uIdvOr5ZnlloB4TeG59DXZUMSM= 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-bs11.server.lan [172.19.170.179]) (via HTTP); Thu, 17 Dec 2020 01:25:11 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:8F2C1R9BgJocKcuC65h5YtbEMbsRjNT0bNgGNrhSuFx0NB+qVM9iNW4VgOSZ8SRgg22n4 gb11Zsx9CeRqOzbMh/ikZ7kuSlSl/UhyvNQRdmH3S419rNZtVFxq2VbA7kK7zsiD60Bk/vRa5khi gMqhNnG2tUc3IYRfMuBgte7aFfXXE0RfG7uiPhDe9PzJ2yxIVWaI+ZhG7i8sAHwB/0DK4gjuWenV 89GqibR1pyedMoI4t9A5XT9Z7SSdBUzWWRA4/2xc2eeWiMDxPrAiE0nIj2fIir4Sc+bvRyslHZWk kI= X-UI-Out-Filterresults: notjunk:1;V03:K0:ZcDNHUPUU3M=:H2Stkl3mbxlBcyDfZcAT9e EKastdQD0TOpaqpowrsCUtxMNV69Ux1nwSHE2KXyQqElalCiKTqmELjdptEpa8gfp7mDLbQh3 2u13HSVGVu/kc33b2tZV9S05rHlzDnNOVyWj01mjrvY5o3XaUNR09GLPFATGwIZjL+tCP2qrj 7a5VA2AGbtXeEPzfQLR7dT4t0N/NRedU+p4beDwISimVXO+7KaBbFhImPdnty3mPpsYP6L4a4 NJ5/zqTl8JcH7BarEf5ablFtblekOVLFASXMnVXsV3A8tFCmREQU2ypASDIz9x85kVB44C0mK /cp7PK7EMFaYoL9r/Dsavu5nF/swnkgQcZ+bbpsnCkKWxlyeVTeOJKy5lxJy15TTjsokngRNS VQc0m47IPPmbb556Lb7HTyiqsGh4zK20/o1Ywf4eRtxDyOK4Q2NK1lluxP/52mayovrExpC3l 7RdlcRp9xRPGgBNOU7JQ9uXTQJCsueOpn30ac2rsc4k78AfKYO84bthzaeen5NErAEHvd4iUM D4VqjqoSrQEeBPV7ojeqtRth5pQvCehoWZV+loCAbvr5hmT/LNeNk02BdRbUfDex+G5ZCCYO3 +y+KjEkZ9Uy3Q= Received-SPF: pass client-ip=212.227.17.22; envelope-from=steve-humphreys@gmx.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:126433 Archived-At: Let's introspect two questions. 1. In what simple circumstances would one use a "setq" in the body of a le= t? 2. What simple option does one have that is more advantageous than using a= "setq"? > Sent: Thursday, December 17, 2020 at 1:10 AM > From: steve-humphreys@gmx.com > To: "Help Gnu Emacs" > Subject: Understanding the "let" construct and the setting of variables > > I have been writing some elisp to set the time grid in the agenda. > The discussion progressed towards the use of the "let" construct. > > But, the discussion got too advanced for me to follow the different > points of view and make a decision. > > This message is for showing some examples, of how to set and use variabl= es > in a "let", because people criticise using "setq". But discussion needs > simple examples that would not overwhelm a relative beginner. > > (defun timfutur () > (interactive) > (setq tim 845) > (setq tsk 80) > > (setq thr (/ tim 100)) > (setq tmn (- tim (* thr 100))) > > (setq tinc_mn (+ tmn tsk)) > (setq tinc_hr (/ (+ tmn tsk) 60)) > (setq tinc_mn (- tinc_mn (* tinc_hr 60)) ) > > (setq thr_futur (* (+ thr tinc_hr) 100) ) > (setq tmn_futur tinc_mn) > (setq tim_out (+ thr_futur tmn_futur)) > > > > > >