From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Distinguishing `consp` and `functionp` Date: Fri, 26 Jan 2024 19:22:56 +0000 Message-ID: References: <86msssble8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000049549f060fde4a96" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14102"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 26 20:28:43 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 1rTRsY-0003QL-Uy for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Jan 2024 20:28:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTRri-0008UQ-AQ; Fri, 26 Jan 2024 14:27:50 -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 1rTRrg-0008UI-SE for emacs-devel@gnu.org; Fri, 26 Jan 2024 14:27:49 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTRrf-0001li-5O; Fri, 26 Jan 2024 14:27:48 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50eabbc3dccso867472e87.2; Fri, 26 Jan 2024 11:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706297264; x=1706902064; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aLZWZxJfweh2a6+srN3YOE51VhmDIbskYWw4HFdW/8k=; b=espUEIyksft3kVXuqUJ1DSrVy4YaHsTgE1VhFDZiWzLdPCzFYNASaDF5fSTsYX11W4 7zbQVkopg1V97GsBvld79v7i0ky70l8CU2p8qLD7ClJD5eXiqVvjJWpnO2zhkMFzGoMJ RVDgsh08GhzpvqrOw6vErKnXKhjYKdGTCPiCFp8DKh3WdzxVB5e2YuKpDSctp+cPwlfQ Wf24yBEZuIT4ivpMV0RWY7fo766IElD3V+kvVlRHfavqbkErV9CVaZlTypM+ZRCrqa+a 3Z+rVR4elZHUbPlfSZkxTisOwqqTmG7iXBPtNaQfk8B1OPkGcHCzKe3FzoV0Rl5vcU/C GU2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706297264; x=1706902064; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aLZWZxJfweh2a6+srN3YOE51VhmDIbskYWw4HFdW/8k=; b=Rqira6AKkmypqDucLSf/JoGL/zzzAy8gdQYfJ96VDokLDEScNLVLBbbY7sV9lqqWQE bTmHnPzcdC8dZGxW9rvowwIQdgtNXm9laS0yjaHAoAXGaCCWgmGikBwvxbC4QxbSUYHT EpL8qiELqvxoqXgh8Kh8PsuYddXtzN2NzXVkjKsAuaPgfxs23nq9n+LMojZBKO5kFQmH vpl6QLeNHrdLc+ZYhYdzgHj9FdageRKI0+OKe/zxEB2UrMCeFTbC5amoxIrymjVGTNK+ UakhJC4KMJJFxStusmycpu7HQhjNjUCw+awZ//Zfdms5yKJzdcO7VLIr7VQIkJ6v8vdt qJfg== X-Gm-Message-State: AOJu0Yw6XRCdD8uFjEA0sQeGM55jYELxNvnJnlkUiv6m6IwIkPaprzJp /QavIgqMRkDbsg1rsKsrZp3U3k8lFIhSeMXmATFJkwaDwnRGRc4RjQUPLqVdTmSzVzWsjpvPZ9F gX/4cL/T9czgT7/3mgPElhj5a3Rt0OYTq X-Google-Smtp-Source: AGHT+IE9Zt/wtkSHThNvsb/r8yFWx/LkSKh3DGQuzoM9t+V1BI4p9JIYsCNFtd9QI/SesJI8qSZQ8i0ECMjmbUIUG+w= X-Received: by 2002:a19:7705:0:b0:50e:a72a:aa38 with SMTP id s5-20020a197705000000b0050ea72aaa38mr72418lfc.55.1706297263738; Fri, 26 Jan 2024 11:27:43 -0800 (PST) In-Reply-To: <86msssble8.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x134.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:315435 Archived-At: --00000000000049549f060fde4a96 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable LOn Fri, Jan 26, 2024, 07:32 Eli Zaretskii wrote: > > From: Stefan Monnier > > Date: Thu, 25 Jan 2024 18:15:48 -0500 > > > > I've been annoyed at the use of lists to represent function values for > > a while now. For a reason I cannot fathom, I even managed to reproduce > > that very same mistake in Emacs-24 with the `(closure ...)` value for > > statically scoped interpreted function values. > > > > That was a major blunder. > > > > In any case, I'm playing around with a "fix", making lambda evaluate > > (when interpreted) not to (lambda ...) or (closure ...) but to > > a self-evaluating value that can be more reliably distinguished. > > Maybe I'm missing something, but I always thought that having code and > data indistinguishable is one of the strong sides of Lisp. Are we now > going to make this advantage smaller, by deprecating the use of lists > to represent functions? > The printed representation has this "homoiconic" property, yes. Not necessarily the internal representation resulting from code that is evaluated or compiled. And not desirably. I _think_ Stefan is complaining that some objects in the lisp runtime that are funcallable also respond to consp, and that makes it hard to distinguish (for purposes of optimization & tooling, I suppose). So basically: (funcall (lambda ())) Is fine and correct, but: (funcall '(lambda ())) Shouldn't be fine, yet it is. I can't check right now, but I think I know of at least one other Lisp that allows this. Jo=C3=A3o --00000000000049549f060fde4a96 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable








--00000000000049549f060fde4a96--