From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joel Reicher Newsgroups: gmane.emacs.devel Subject: Re: Commands, term "closure" and online help Date: Sun, 14 Jul 2024 16:20:47 +1000 Message-ID: <86h6cs1olc.fsf@gmail.com> References: <861q76llng.fsf@gnu.org> <86y19ek6hx.fsf@gnu.org> <26141.19574.948512.394768@retriever.mtv.corp.google.com> <86v84ik3bp.fsf@gnu.org> <86ttgs1s11.fsf@gmail.com> <87sewcplet.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24278"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen To: Michael Heerdegen via "Emacs development discussions." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 14 08:21:46 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sSscD-0006BG-Su for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jul 2024 08:21:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSsbQ-00024p-BX; Sun, 14 Jul 2024 02:20:56 -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 1sSsbN-00024W-Nb for emacs-devel@gnu.org; Sun, 14 Jul 2024 02:20:55 -0400 Original-Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSsbM-0002zc-3l for emacs-devel@gnu.org; Sun, 14 Jul 2024 02:20:53 -0400 Original-Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3d9e13ef8edso2108054b6e.2 for ; Sat, 13 Jul 2024 23:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720938050; x=1721542850; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=J5xOI2KumSd4ORwSS8cbfIWC863Whl2pm5z6n6Co8V4=; b=GQuuBFW95eGomQMqMuD/Uq7kwtXiFIdyH0+GjmPDE+nIBtV+wFDeLe3BT+GtXvqlJ2 0dmdYbu4FmFP6ngrYYwnNU1O/X7f9G+mBGQtQpElReMae8pvaYZ7ehKoWfREHr3aakLN QVzYHA4d11HWJjni9tlISymwDD8tt4vFqeX8Wln78bNnVANl6vlZusVmN0Fl9H+5CCXu eeJK+ecbNGOTHsNWK71XcWfMPacCpKwTB6MMo0aiP38C+TnN+sFtfQieJ/x7ToAyHF6S oWvxZTkjyr3hA63Qb1S+KuyHF4iLSxSc/y0sLGQhEpGVNDFJFg1X/o7zoB0VfFD17h3f UmAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720938050; x=1721542850; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J5xOI2KumSd4ORwSS8cbfIWC863Whl2pm5z6n6Co8V4=; b=tU2h8CI+jkI3JwL6VwVvoRiyhaqxcxMhZtR2+77RF+Z5hwaA/XnyqwI5AM28nXmIWA yDPTj9m03oeGex2L1TfjtZwb6U5HG4e0Umnk3lx6eWr6kSwRz5r7BWgxvA3zYYMMnBC0 jtTBb0CctaPmqpM9xA94Ib63IvsGIqVqgQzKa6APTyCvE0XHigcCWcHdAbOTpheJ3M9E 8WtidDGNga/9eYLi9mVHR7L+wQp0PhbcLuGVSzPucfgkdziEzFUxm4cikKtKKRx5s8e+ IQKc7m+KNAkxCjKURlsPbyKTz7SF1zdQn+YPVaEo7IZZj4+GIHFgudxeXSeo/P9nv3tM ipGA== X-Gm-Message-State: AOJu0Yx4tEVDEaVIZI+QpCUzqYams7YKZvn5ZmksZksCaMQU+8vyynm9 GXPWtwYKITa/qB50ufm3Pj5evLx8SZGIj5YcifaTFko/sio5KovO X-Google-Smtp-Source: AGHT+IHM/wRH3ogfnM5RPEVs7sCSJqwt9dL/9bP/z3N3GcgUS+WrUNTYXlTaEaXyWoiw82Dofqn7lw== X-Received: by 2002:a05:6808:f11:b0:3da:4c28:6697 with SMTP id 5614622812f47-3da4c286807mr14100700b6e.38.1720938050531; Sat, 13 Jul 2024 23:20:50 -0700 (PDT) Original-Received: from LAPTOP-ACR66VVN (139-218-25-158.sta.wbroadband.net.au. [139.218.25.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fc0bc46562sm18700415ad.253.2024.07.13.23.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 23:20:50 -0700 (PDT) In-Reply-To: <87sewcplet.fsf@web.de> (Michael Heerdegen via's message of "Sun, 14 Jul 2024 07:55:38 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=joel.reicher@gmail.com; helo=mail-oi1-x230.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321627 Archived-At: Michael Heerdegen via "Emacs development discussions." writes: > Joel Reicher writes: > >>> Ah, now you are talking! Indeed, functions defined with C-x >>> C-e are described as closures. What would you like to see >>> instead? interpreted-function, perhaps? > >> Perhaps "dynamically ..." rather than "interpreted"? That word >> is used in the part of the elisp manual that describes defun >> also. Something like "dynamically generated function" or >> "dynamically defined function"? > > Aren't "dynamically defined functions" bytecode functions when > running compiled code? So this would not be a better term. Which bit of the documentation are you thinking of? I can't find that phrase with reference to bytecode. > AFAIU we want to tell that these functions will, when funcalled, > be handled by the interpreter - thus, are interpreted functions > in that sense. My understanding is that the closure is constructed the moment the defun (et al) is done, regardless of whether the function is ever called. I'm not familiar with the implementation details but it looks to me from a trivial test this happens unconditionally; even when the function being defined does not capture anything from its enclosing scope... (defun blah ()) C-x C-e and then C-h f blah to see what I mean. (Maybe this gets optimised later?) That's one of the reasons I think it might be helpful to refer to this simply as a function that is "dynamically created", or some variation on that. Regards, - Joel