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: Distinguishing `consp` and `functionp` Date: Mon, 29 Jan 2024 14:45:57 +0200 Message-ID: <86bk9448ai.fsf@gnu.org> References: <86msssble8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10285"; 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 Mon Jan 29 13:46:56 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 1rUR2O-0002Qa-BD for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jan 2024 13:46:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUR1c-0000sr-NU; Mon, 29 Jan 2024 07:46: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 1rUR1V-0000o5-3f for emacs-devel@gnu.org; Mon, 29 Jan 2024 07:46:02 -0500 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 1rUR1U-0003PF-Cw; Mon, 29 Jan 2024 07:46:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lLz5wPqSGzZDdsN0s5HLV7pUblOvHNS2wOZiN14j0uw=; b=Ke7jJsu0nM4p X1KO5aHcHhUKvQ6RLouYTXdP9OFS6LRpvKNM3VDyfiIsrje3JSOtKsJlsag/Lg12ZuW6lXbe/Efge kFSnJpkJHAanTBjbD6ZaQ8EgJg2A0GAaU/MCw+5f28pHs5bBCt0finLBxdY3YAomygX9xxp3lGG5A nUSfFJeXL8Ce/xnx0bM1+p616tba/v6fu1hMUtLfrp4mV/T1ngjJEDa+2pB5IweK2cgyDNRSJbDQQ N8ECo2GdWzEJikTy1CHvNG+BdMkbrVEOehEqykIkarhfldxdsgUHrQQmhf+SYh04/cj2YAByikSkz l4USwrJTtq614l+YsAhqQA==; In-Reply-To: (message from Stefan Monnier on Sun, 28 Jan 2024 16:27:27 -0500) 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:315586 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Sun, 28 Jan 2024 16:27:27 -0500 > > > 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? > > A function *value* contains code in some representation that depends on > lots of factors. In practice most function values in most Lisp > implementations are not just plain lists but are somewhat opaque data. > This is also the case in ELisp where most function values are actually > compiled either as bytecode or as native code: we do have tools to look > inside, but they're definitely not plain old lists. > > The "code and data indistinguishable" is something that usually refers > to various things: > > - the source code (which gives us powerful macros). > - the availability of `read`able print representations of functions (tho > that doesn't apply to native-compiled functions, sadly). > - the ability to embed any value (including a function) into source code > via `quote`. > > Those three are mostly independent from each other (and are not affected > by my patch). And if you ask other people, they may give you different > answers. > > But looking inside a function *value* (i.e. what is returned at run time > by the evaluation of `#'(lambda ...)`) with `car/cdr` is rarely > supported in the Lisp world. So your patch only affects "looking inside a function value"? If so, what are the situations where a Lisp program in Emacs would like or need to "look inside a function value"?