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:49 +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="30923"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 29 17:35:18 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 1rUUbO-0007po-Mx for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jan 2024 17:35:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUUbE-0007Od-7g; Mon, 29 Jan 2024 11:35:08 -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 1rUUbB-0007NB-Ui for emacs-devel@gnu.org; Mon, 29 Jan 2024 11:35:06 -0500 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUUbA-0000Cp-3n; Mon, 29 Jan 2024 11:35:05 -0500 Original-Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51109060d6aso2206379e87.2; Mon, 29 Jan 2024 08:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706546102; x=1707150902; 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=E/CawrhAzq73OKdEB9gJ6aiyByEmCOEXp0TyG9oxqh8=; b=gmaRxQ0jrNMcw7Q/h2FYzc2vGu8jy86LP2cMNA6oViZSfltVLe0cZ8ZKhxb3V4wd0n TecjGxEn+k3lQmTWo/lqAhhJIMLk63mmkRaIwsgG3CopdA7l9eO/gagLJzg+5XEXRj1Q kHcvvNf0tfMFvebMfOd3j5WTqghTmz4RySsycN5yyK0c0csNDIzdd6w2ZdQuVJvUWsDj /I0HhhHaGpLD/oH7wxNI9bvWNY9OQaK1tqqJiuAI9KK5lTLGTvTTx9kKtsm2wvcYfEhJ oKutVbYDd+PplrPibNqDyiHlV4B37vLMa6JXGkf9IijWYaM3+XmdDWJe7d/1U/MHYODU vOkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706546102; x=1707150902; 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=E/CawrhAzq73OKdEB9gJ6aiyByEmCOEXp0TyG9oxqh8=; b=HKWLPi58P4YVtBfYG/jEpO7ChDqcLeY8v9sRZ6Xcj8SZXIWFOTF/uM61Nc2/enUVeR WjL0VvTGOpG5PIB2dlMmboxBKeyf3ZynzHQWe0OLWXKcwSVJT0CwXf7wdA7PstG6OS7u TNusUJNTdH2no41GS5Zl60lY5emRKt6O5QlS7LgROkw6L/80gWg8Jxad5vZ3ComDAnNr 9ihTc93M0yBHEvco/bgHSS/+6X2bBF6car0Nw7WHit3iu2tccjmzk0KAjSdNGDBufO2L 95lqEpsw4RvEUisde8RmlUC+IxyP1ncjSjSJp64BdkxmgmadYWsuDxCd8lk68mD7per2 hFzA== X-Gm-Message-State: AOJu0YxDWCILi0Lbfl/E6x+guNHhZqeODBTUwg4fbvym05b6yK13x8VT zaCZcM828KEQqgyqnkXwQwqNB16KY83L1dtiUcIDbRD8TrR4//B+yGgQ9xg0B04gm42R+BFkgxW VJk7R+lBp87B2hqwlJKN8a2cRgL7BUpYilAo= X-Google-Smtp-Source: AGHT+IHpK2r5UjuzFvYZ28g8h6rfsDnyDbq8lQfUrylIV1S/L18Q4Ffy6YcCUNII8vo03pyJIXrWHC2qgKfoMkoRQnw= X-Received: by 2002:a19:6558:0:b0:50e:246d:7566 with SMTP id c24-20020a196558000000b0050e246d7566mr4778127lfj.7.1706546101456; Mon, 29 Jan 2024 08:35:01 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12b.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:315603 Archived-At: On Mon, Jan 29, 2024 at 4:28=E2=80=AFPM Stefan Monnier 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) > > While it's in the vicinity, this is not directly related to my patch. I know, your patch doesn't address this. But if I understand correctly it makes at least functionp return nil for the second one. Or at least makes way for it. And that's a plus in my book. > > >> commit 9228fd983bb9e71d44d406433a46495b22640801 > >> Author: Marten Lienen > >> Date: Mon Jan 22 11:08:44 2024 +0100 > >> > >> * yasnippel.el (yas-buffer-local-condition): Check functionp b= efore consp to allow closures > [...] > > Stefan's patch moves us in the right direction if just for the guidance > > it gives to ignorant Lispers like the one who introduced that bug circa= 2009. > > FWIW, the bug fixed by the above commit was introduced a few days > earlier by yours truly, Alright. I wouldn't be surprised if I wasn't passing lists as lambdas around in that extension. I used to do that, and saw many fall prety to this, when their lisps allow it. The result is harder to debug code and harder to instrument.