From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Lexical vs. dynamic: small examples? Date: Sat, 14 Aug 2021 00:34:31 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6963"; 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 Sat Aug 14 05:35:08 2021 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 1mEkRw-0001dJ-Bt for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 05:35:08 +0200 Original-Received: from localhost ([::1]:35348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEkRv-0006yc-2v for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 23:35:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEkRa-0006yT-My for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 23:34:46 -0400 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:56118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEkRZ-0001xu-0S for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 23:34:46 -0400 Original-Received: by mail-pj1-x1035.google.com with SMTP id w14so18130933pjh.5 for ; Fri, 13 Aug 2021 20:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=1eCOesfgJUavZoZBvykbaRoHus1sg71G/4+F3fMlmsg=; b=WpI9QbvKAWtfg9wprPokKELV8JICh+hgA4siKe0cGq+hlarVXeqQx/lVyz/dQmC0hM SymLC8J0mZEZGw3zrIGn/O66JVA0+y1f8/decgDGyFf50sUWIpS2DnllYdlebQPwoMad CA+3Y6UrKpuu5NmfliRUa5J5i/Wi00GAovykDHMOF3fek+7H2jD6JlxQMNL6ozlg6xAH RVsBShAYQs9InqFyp9ftsenWoc63RIG5n+vo9G/0mrLu741C/l1V8kaF2Y7NN9vg5LkP +vRW0hPXQmh3uB1KcsUAeRaNDIeKKLWEf9g+P7Pad2ipHy/h4uDqiwolocMt1zUuSzEj L+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=1eCOesfgJUavZoZBvykbaRoHus1sg71G/4+F3fMlmsg=; b=KNHqT/M4HggeRMeEbV8ueEBv6tvWZ3rgfVp3lab1tPwSt1rtDvp3w+Xaq5P/MA29Kx pynuV5qn5rNrWgp1nTnyBX0EbMc5OhIJYEIOAPF3V+eQhJVWjS5nf1fEDG5TKknn2YjE EPFVsOUuYPg+d4wz9HUti5yk7XUO2J3pFLqX4QUmE+Pzxzg+MgKd1E6tGVAnKqVOX0kh Vth7ORXyU5i3CIUno7brh746jxnP3pabd8Pn9RYcVtfigrPx/pK8yGNhgKFhwJJ9hMLo 8Zri/v/IMuZ8b8EQbGI+qysgZ/bQmURpbAsCoQgpJQtBCqYRyUXq9uekuBKQ3h65jNJG QDyw== X-Gm-Message-State: AOAM5302gMNeI//KLfht+coL3VOUYbiuTGrbFawv/QS4+lYBtxXlYYED cHCbeRqCBZZFozOGGk/SQWhgO0PNiNYMzk3mAFYiANTWt1wJjw== X-Google-Smtp-Source: ABdhPJxd6HcnAkWV6l28jBT3ntwpvfYRw/LoTrCX754Tt65NPTeZHGR/9nAd3X/odFQGmNroOglqr2d0spgJzRIWdaE= X-Received: by 2002:aa7:98da:0:b029:3e0:8b98:df83 with SMTP id e26-20020aa798da0000b02903e08b98df83mr5435187pfm.63.1628912082589; Fri, 13 Aug 2021 20:34:42 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=eduardoochs@gmail.com; helo=mail-pj1-x1035.google.com 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_DNSWL_NONE=-0.0001, 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:132527 Archived-At: Hi list, I am trying to write a section on lexical vs. dynamic binding for a tutorial on Emacs Lisp, and I am looking for very short demos that show how things work differently in dynamic and in lexical binding... Right now what I have is this: http://angg.twu.net/eev-intros/find-lexical-intro.html (find-lexical-intro) I have tried really hard to the make its section "0. How to use this", that is at: http://angg.twu.net/eev-intros/find-lexical-intro.html#0 (find-lexical-intro "0. How to use this") both clear AND useful to people who do not use eev, and I think that the big example in section 3, http://angg.twu.net/eev-intros/find-lexical-intro.html#3 (find-lexical-intro "3. `get/set'") is quite nice - especially because of its last part, that inspects two different getter-setter pairs, shows that their lexical environments are the cadrs of their closures, and shows that `geta' and `seta' share the same lexical environment and that `getb' and `setb' share another lexical environment... My current knowledge of lexical binding stops there, though. Any comments (or help) would be very welcome... Cheers, Eduardo Ochs http://angg.twu.net/#eev