From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#66756: 30.0.50; [PATCH] Improve discussion of 'let' in Elisp Introduction manual Date: Wed, 22 Nov 2023 21:57:50 -0500 Message-ID: References: <3ade119d-0f0d-e60e-1bdc-9c7e02c1559c@gmail.com> <381836df-c16f-b3e7-d0c4-473290e165de@gmail.com> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19688"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 66756@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 23 03:59:07 2023 Return-path: Envelope-to: geb-bug-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 1r5zvm-0004vF-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Nov 2023 03:59:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5zvg-0001HB-Nx; Wed, 22 Nov 2023 21:59:00 -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 1r5zve-0001Gt-RU for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 21:58:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5zve-0000NF-Cf for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 21:58:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5zvh-0002ae-VJ for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 21:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Nov 2023 02:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66756-submit@debbugs.gnu.org id=B66756.17007082839866 (code B ref 66756); Thu, 23 Nov 2023 02:59:01 +0000 Original-Received: (at 66756) by debbugs.gnu.org; 23 Nov 2023 02:58:03 +0000 Original-Received: from localhost ([127.0.0.1]:60300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5zuk-0002Z4-Ng for submit@debbugs.gnu.org; Wed, 22 Nov 2023 21:58:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5zui-0002YW-Ca for 66756@debbugs.gnu.org; Wed, 22 Nov 2023 21:58:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5zuZ-00008L-BX; Wed, 22 Nov 2023 21:57:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=zgp0G0W/q5ZuItKjGE2QSJ7NkKSC94DfOcMZzpfMbFU=; b=avGSICI9LBer JRCWz53OBzSS/LVvUMKzeTzsdcI4tnjZJHPJPCrRUcZILOC8b7HYpjt1TBA36GcfC0xuM/XINZANl N88niIZUqKULxJ9t1UNe9Io/wOASV58VdovxSm//P+Qfp8bgA3bYaNKcwcUnMGrVFSwmlmMUhIywf qm4Ee5oK/4kIM+1tvGQUpdGmdVNGB5TC5uPhY2Ww/sbSKKvddzqLpdU1oviLT18T9sslShfBa87qI 1Wu1RyyqsGuFiTt465aLIypyO5yo2/s8NSTJ7jR8CdKB9B6bN6J7YdIQ9X6N/0Jd7aiJ3RPEBsjjj VCEbywzyNcKoFDkinPYGvA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1r5zuY-00041H-Bl; Wed, 22 Nov 2023 21:57:50 -0500 In-Reply-To: (message from Jim Porter on Sat, 18 Nov 2023 21:30:11 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274788 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Your work is good. After this, > +;;; -*- lexical-binding: t -*- > + > +(setq x 1) > + > +(defun getx () > + x) > + > +(let ((x 2)) > + (getx)) > + @result{} 1 > +@end example it could be good to add the following: +(setq x 3) + +(let ((x 2)) + (getx)) + @result{} 3 + +(setq x '(foo)) + +(let ((x 2)) + (getx)) + @result{} (foo) +@end example to show that `getx' accesses the current value of the global binding, not the value that the global binding had when getx was defined. Adding this to the lexical binding example +(setq x 3) + +(let ((x 2)) + (getx)) + @result{} 2 + +(setq x '(foo)) + +(let ((x 2)) + (getx)) + @result{} 2 could also help, by showing that changes in the global binding's value are irrelevant for references to x where that binding is shadowed. Or perhaps this pair of examples should be presented as a separate point following the other one. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)