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: Wed, 31 Jan 2024 10:51:07 +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="4686"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 31 11:52:22 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 1rV8Cb-0000z6-2b for ged-emacs-devel@m.gmane-mx.org; Wed, 31 Jan 2024 11:52:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rV8Bm-0002zv-TT; Wed, 31 Jan 2024 05:51: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 1rV8Bg-0002zi-LD for emacs-devel@gnu.org; Wed, 31 Jan 2024 05:51:25 -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 1rV8Be-0000UH-T4 for emacs-devel@gnu.org; Wed, 31 Jan 2024 05:51:24 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5101f2dfdadso8487026e87.2 for ; Wed, 31 Jan 2024 02:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706698280; x=1707303080; 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=qYkLPkaJtamjvb7FjHLCxqXI0gkV+LW9paVlu8TwgIk=; b=aJHPnWtTnGOLFsydEb1nWpYzRtH13cBJF/WcxiC5xq0KEKdg7pMVaAEZXhKhC624aD XEyDH/M02Mjh7poaMA+1jgT0YimK40CytJaaDrXOibDt9q1ZEKZUYNKa8cku+7rxAhyo AJM5QTJtB+xvKvf1KFIYS7isijTEbLunS8grbv5FGRQnebdDqI4X2eHcY1mk4bdJgCyt Hlnqtkx7T8CgleEN6XjqigpiYNa9cJDQFgC4zd8KWpgyS+PsGRr3IqQbGAIyBniOLk8I kLd8mQ+EPAm8A2W7wFWXeK4cV0LS11KY5Lr9pq3gaavgOJ447+uUbHNZm83s1elUl370 k0jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706698280; x=1707303080; 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=qYkLPkaJtamjvb7FjHLCxqXI0gkV+LW9paVlu8TwgIk=; b=WatWLJPam1hI5CSmBuuobcn1qtFPw+JYWHVzHELHFxeRg5qt4jIjqIYXdi++Deq8Ik xh92OwgrI8nehXn4O2xRPit38EUki0HD851n1pxqgHroBR5VbTKSw6N8M9eJHJgFGR+a /9Jwrz8X3mTPC7tfmkzdlkyOLnbhTXit8sMLIzSU1Zd1f1CGY2PHU29sR8MzS+b4SJyI FyijdhxK0MlYu1NhIUyLm3IuAqqLUDi7863rmXYfjF4B5J2YhZPVmt6EOqzC4c5CT8/v Zb67cgmrVCj7LY0dy/rdVo2dGIfvogzbGY6ywO15fAvZWxhttErlIUAC4OcBhKhTCCXi 8mNA== X-Gm-Message-State: AOJu0YzvfsBLk1PYmFjeGRZq/JjcFTGAopSEEti3vqti3f+HuVefFR4C VZnK8E/KU5SdkM+gpOwineek86GTd63ILPdUkhKEXxq4IXJyuesJbC4tbbGU11fqPufvs+SPqvE dfNWzHT5Ft9e6QTvf3OzRnkoGKwGG+V3g1ms= X-Google-Smtp-Source: AGHT+IFtXjkmf6tondTd5R/bQjMvXNfDoF/9n0ldBIWwL7RGcjRv8PZ2AzBzG2OqqN//NArrPnp0/6+UsRwnguEtB/U= X-Received: by 2002:a05:6512:368b:b0:511:17b6:5dc5 with SMTP id d11-20020a056512368b00b0051117b65dc5mr944924lfs.12.1706698280277; Wed, 31 Jan 2024 02:51:20 -0800 (PST) In-Reply-To: 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, 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:315661 Archived-At: On Wed, Jan 31, 2024 at 3:37=E2=80=AFAM Stefan Monnier wrote: > > >> > Dunno. SBCL's compiler is pretty good, it propagates types and war= ns > >> > say, when using generic+ instead of must faster fixum+. > >> Knowing "this is a function" isn't terribly better than "this is > >> either a function or a cons cell starting with `lambda`": it will rare= ly > >> let you turn a generic+ into a fixnum+. > > Isn't knowing "this is a function" a prerequisite for proving e.g. > > "this is a function returning a fixnum"? > > Maybe it's a prerequisite, but it's pretty damn far from sufficient: if > you're in a position to know that it returns a fixnum, then you > most likely won't need `funcall` to tell you that it's a function. Not sure I follow, but fair enough. Big or small, whatever benefit it brings is certainly more than the benefits the the current situation brings which is 0. ...apart from working with legacy code, of course. So as I said I really think you should leave functionp returning t for a good while and warn about the funcall. I think that'll make the numbers of these things dwindle. It's a fairly common error, not only in user code [1,2], and the warning would have just told the users what we end up telling them. In fact, this is probably so common that the warning should have some kind of anti-spam safeguard, like not warning twice for the same object, or just limit the number of warnings per session to 5 or something. > There are much lower hanging fruits. By all means go grab them :-) Jo=C3=A3o [1] https://github.com/joaotavora/eglot/pull/626#issuecomment-786606685 [2] https://github.com/joaotavora/eglot/discussions/691#discussioncomment-7= 19357