From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Should `indirect-function' be preferred over `fboundp'? Date: Thu, 20 Jul 2023 10:42:27 +0300 Message-ID: <83wmyv2fmk.fsf@gnu.org> References: <87h6pzxdof.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21499"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 20 09:42:30 2023 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 1qMOIv-0005Ng-Od for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jul 2023 09:42:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMOIO-0008G8-I2; Thu, 20 Jul 2023 03:41: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 1qMOIM-0008Ft-I7 for emacs-devel@gnu.org; Thu, 20 Jul 2023 03:41:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMOIM-0006lz-8h; Thu, 20 Jul 2023 03:41:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=/vcwTCK8ita4BRdIsbsg6ldWHUFGgZw4CXIVo+WGLF4=; b=MM1R2Lx/JrO9PIqTR2EH tG0n2Hw+0qWvNstpwvjvBOj/YuO3J5/SxQA7l11YIJTg/CaBxBKCBoujfv1My6Je5Ku0WjZiGXBHs E5dS2S2c5z8dCcBduM7G55Cbizse9sXCIlOhW5cGlMqXzPn+PiYdREUv3xJgeVimx+BFb1JUkA+L6 1mWmPYVeAxPN5RCkZO3aO+I7kzsfJ+bDdn+bN3+pPEFjjcrs23iFA5vtIygKxXOIEJTXQ7M5v3TiL zGTAcAjUm5MxMqrB7xR1+580V7lUVrFUsVZQT30l23i5+0IKXnVL7yXE0XsDLICfoNk8xEx+3+OGb cg1Mu7eoZ9/3Ug==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMOIL-0007VH-Q3; Thu, 20 Jul 2023 03:41:54 -0400 In-Reply-To: <87h6pzxdof.fsf@localhost> (message from Ihor Radchenko on Thu, 20 Jul 2023 07:08:48 +0000) 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:307983 Archived-At: > From: Ihor Radchenko > Date: Thu, 20 Jul 2023 07:08:48 +0000 > > (defalias 'yant/foo 'yant/bar) > (fboundp 'yant/foo) ; => t > (funcall 'yant/foo) ; => ERROR: Symbol function definition is void: yant/foo > > In contrast, `indirect-function' does a better job determining whether a > given symbol can be called as a function: > > (indirect-function 'yant/foo) ; => nil > > Is it something widely known? The ELisp manual says: -- Function: fboundp symbol This function returns ‘t’ if the symbol has an object in its function cell, ‘nil’ otherwise. It does not check that the object is a legitimate function. So this is at least documented.