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: Mon, 29 Jan 2024 16:34:06 +0000 Message-ID: References: <86msssble8.fsf@gnu.org> <86bk9448ai.fsf@gnu.org> <864jew40m3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 29 17:35:10 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 1rUUbF-0007Y2-CH for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jan 2024 17:35:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUUac-0006tB-RQ; Mon, 29 Jan 2024 11:34:31 -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 1rUUaU-0006sP-4D for emacs-devel@gnu.org; Mon, 29 Jan 2024 11:34:22 -0500 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUUaS-00005B-HD; Mon, 29 Jan 2024 11:34:21 -0500 Original-Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5110ef21c76so1990344e87.1; Mon, 29 Jan 2024 08:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706546058; x=1707150858; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iDW5ooPg96crzklRvzPk0WlSAWuUrASgkbwWJbKFRwo=; b=BFgaisa7PhVvcfWRwj8tBQsj8DqnnzOxR9jfaZwVYp0W79HBp8fEDy0f3SRC0+Dq7g 0hxuQOUSt1YmMnRZqjuqW7LET4BZhBzEw2kCFDw3qLmtt13lKYiESvC7flbbsmXFN66T KGVjWHSahxAyIqVC+BEuOtbJkj/cdjI3PcQbkPLrUkIDE0woYBuADIAQ0cHWJE9n9msz nKXrQyIdatRxOwmS2wPhr3X9OT5Y27qoY36hM774WXgQTvVCndKyIsgzPk270HASGFNf 7VdfPBGiJw6qnBpgReKIycv7ZItt3ZM3zUwsA4/gL8pupAUjdkKCGkBjwHHk6KHvu+Gd viOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706546058; x=1707150858; h=content-transfer-encoding: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=iDW5ooPg96crzklRvzPk0WlSAWuUrASgkbwWJbKFRwo=; b=UNwjJ0KcPxA6IRraiplxuOzphMAdbSNMarbkhJreJio4YNCz9sXGl04aCwJO409+99 AidgQ3xTRPlfRY4Aw7xp3bA8iBfn1gE8fho4A/7tD0UvwBWWfRGNn18UdZWHMELjtatF mHUZoYOLoD+2phmEIqr6gDjIwuPowtFnM85jzgbbseXiZd2JVY5yHK2/DqnfOhJ2go2J 0EgpSOE56R8u72DHQ7Z3nS/fuxkE2/lDV5AotlydEDMmtZMCNk5OeGi9JZ/ttXV6/UiP iaQh0hiCgPDzoHt25jy1KGkkRIsuyEzkI6/Ath9laHhzbAcmN3KRp0LY31L2sAeSrlr3 Ol2Q== X-Gm-Message-State: AOJu0YwQFTaC9cJmAEJ7kDd0oxJwMXIXA/hXUSJdUkdWBTgxyMsRWL7g KuhIYcX4qofOhrqM2IOBw5Tj26wMxqkRXEsUjZGTby+BdE36eU8XEh6iYc6xaHuG0Disu1pJDNf AEr2eBvCSJp9nibhEvgJzVWyqGxFPMYIqpkw= X-Google-Smtp-Source: AGHT+IHlv+H2l2AraiO3ET71lIwUtR0RNgzmuWaxbwbVykHb7sGRrNywL1nHh2YtzMZ/tX0s9XVumPUtJV/kfVOlmxI= X-Received: by 2002:a05:6512:3e19:b0:510:cfa:31f6 with SMTP id i25-20020a0565123e1900b005100cfa31f6mr4537355lfv.35.1706546058204; Mon, 29 Jan 2024 08:34:18 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x132.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, 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:315602 Archived-At: On Mon, Jan 29, 2024 at 4:17=E2=80=AFPM Andreas Schwab wro= te: > > On Jan 29 2024, Jo=C3=A3o T=C3=A1vora wrote: > > > I don't think there is much space for philosophy or debate in noting > > for example, that a list as lambda won't get byte-compiled like a > > true lambda form. > > > > (byte-compile '(let ((bla (lambda () (+ 42 42)))) > > (funcall bla))) ;; -> (byte-code "\300\211 \207" [#[0 > > "\300\207" [84] 1]] 2) > > > > > > (byte-compile '(let ((bla '(lambda () (+ 42 42)))) > > (funcall bla)));; -> (byte-code "\300 \207" [(lambda > > nil (+ 42 42))] 1) > > Functions should be quoted with function, not quote: > > ELISP> (byte-compile '(let ((bla #'(lambda () (+ 42 42)))) (funcall bla))= ) > (byte-code "\300\211 \207" > [#f(compiled-function > () > #)] > 2) Of course, that's the point. My point is that even (let ((bla (list 'lambda nil '(+ 42 42)))) (functionp bla)) will return t. In fact even (functionp (cddr (list 'foo 'bar 'lambda 'baz)) returns t Anyway lambda in particular doesn't need to be function-quoted though. So there's no need to put the #' there if you want a proper function object. Jo=C3=A3o