From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Effect of lexical binding upon function paramaters Date: Thu, 03 Nov 2022 14:01:44 +0100 Message-ID: <87k04ci43r.fsf@dataswamp.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30060"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:WI5okwkmwNM77WaXT8rkin9bcg4= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 04 12:29:29 2022 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 1oqut7-0007cH-7a for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Nov 2022 12:29:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqusq-0006Lf-Hj; Fri, 04 Nov 2022 07:29:12 -0400 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 1oqZr5-0007Td-4N for help-gnu-emacs@gnu.org; Thu, 03 Nov 2022 09:02:00 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqZr2-0004MH-Ng for help-gnu-emacs@gnu.org; Thu, 03 Nov 2022 09:01:58 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oqZqz-0001Ev-L4 for help-gnu-emacs@gnu.org; Thu, 03 Nov 2022 14:01:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 04 Nov 2022 07:28:28 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140637 Archived-At: Heime wrote: > (defun ignition (featr actm) > "TODO." > > (when (eq 'sweep featr) (setq featr 'icomplt)) > (message "%S" featr)) > > Calling the following sequence of commands > > (setq featr 'sweep) > (ignition featr actm) > (message "%S" featr) What I can see from this test below, formal parameters ("arguments" in standard information interchange) are always dynamic under dynabound, and always static under lexical binding, this holds even in the presence of same-named global variables (and it doesn't matter if they are lexical or special). Yeah, too complicated ... But observe, ;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/geh.el (setq i 1) (special-variable-p 'i) ; nil (defvar j 2) (special-variable-p 'j) ; t (defun use-i-and-j () (list i j) ) (defun vars-ij (i j) (setq i 123123) (setq j 666888) (use-i-and-j) ) (vars-ij 111111 222222) ; (1 2) lexical ; (123123 666888) dynamic -- underground experts united https://dataswamp.org/~incal