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: Understanding the "let" construct and the setting of variables Date: Thu, 17 Dec 2020 01:10:06 +0100 Message-ID: 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="35287"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 17 01:10:48 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 1kpgsa-000951-9a for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 01:10:48 +0100 Original-Received: from localhost ([::1]:51462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpgsZ-0007MV-8T for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Dec 2020 19:10:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpgry-0007MJ-EK for help-gnu-emacs@gnu.org; Wed, 16 Dec 2020 19:10:10 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:46833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpgrw-0002aY-Ea for help-gnu-emacs@gnu.org; Wed, 16 Dec 2020 19:10:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608163806; bh=uigNt0VhswMsrusVZ7GpPjUrXpWStodREEXp2oP69AQ=; h=X-UI-Sender-Class:From:To:Subject:Date; b=O1yCZFpVPGXa/smAp74q6TFhqmW3DknzL7U/QGlR4x2nZ2/xXL5nAMGSotUUhGasa JVLyvnk0RiwokvzMjl+CZvVHswQSjVWmfJzPWGOb+7fGZ/Rl5uInFh8Pc9CCc7mdRm G0u2kId7f/+ZCptpBP4N+d3DHMp3evhwt0H2gqWI= 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:10:06 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:nOby3OxvM81IuIYNoWzlP1c9iuIKwEwXGVC4CLCsqElsWXJa7G1srEWHHJvtS6GY+QHDt 0fnjKCmimuTNxVioP20yFNzjkpez4ogGy/yANjLKyW3ckzdrG4gN2SdG63qzVjpUeGWyeaErkrk7 DSgSMJBn8+0PbgixgEaPFPIUN8amXO2ddsK/h0YQnZa9/xOOFs6C9YkGyfQSA0Me1chX7RSM7rf9 Af0siqkqfpEmvX6l99tHRM7JC1i6ob/8hp/IXESep9aIYHCzBEa76pQhvA//bHyNeAg2owNOMuM5 Lw= X-UI-Out-Filterresults: notjunk:1;V03:K0:KO7YgCJJ0GU=:ZKVqif4B8ZFdYfzS3Vx6EP H+vkEE7d9YwVUfHV9raAlyNpscqdWL3QeXrnj9NXSK64aJ7CDSRYQczFxSoM97MpYEthmMTrY lTAhbiQ+qy2kKuFdYZT6VR1IQsaauTnkxmoQOiktqfTxBJla364yH/+Um3c67O33+/nrZWn+q HwOe4HV6GAejLayDrRLoDywlz6/lHh9TjkviKg9lsfrg69r9UIZz64EtaMi5HIQe+mO4B4qMw 5oYZBELH3AbtX3kmxewiNDNTO0Ph3CRojF515B/yT57M9mvU+BLYGOH4HTnT+zhVdLASmr8Q0 LAALFFEZJF59HKbEpOfKxTzTk5GbNpf5EGv+RXQSENuo+KUdlS5OLaf0ZIIpFT/qMf1W9xNDv SPnpDL2E/nUuZPgC8ck8ghBRHuI8RTZvV1p/0vBhgYniRTdkFfY+Go/tjIT8+ZGPHYj6ODNQ/ Lt46J8OxA6t8wEjHwJBXEH0+8pA+Jo5zFrmfC/+T+PwrJIixV/Up5FYHIcQMNvIotcvvVFMaN Uq9uVnd+TlnQbIIkUuri0+7OEUdh+fYZmtIuMs4nCmnuSTKl0xW07bfNnAR8CcGvcoKmDIAcT PutPDvpspuAv4= Received-SPF: pass client-ip=212.227.15.15; 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:126432 Archived-At: 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 variables 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))