From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.emacs.help Subject: Re: Calling a function with undefined symbol Date: Mon, 31 Oct 2022 10:58:50 +0100 Message-ID: References: Mime-Version: 1.0 (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="5843"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomas@tuxteam.de, help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 11:21:01 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1opRue-0001Kr-GS for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 11:21:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opRu7-0000bR-J4; Mon, 31 Oct 2022 06:20:27 -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 1opRu6-0000ao-1o for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 06:20:26 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opRu4-0006Rp-8q for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 06:20:25 -0400 Original-Received: from smtpclient.apple ([37.170.173.143]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.168]) with ESMTPSA (Nemesis) id 1MtO4E-1p392I1gkA-00uqoB; Mon, 31 Oct 2022 11:20:20 +0100 In-Reply-To: X-Mailer: iPhone Mail (20A380) X-Provags-ID: V03:K1:UJISuJERgFvBckZldvsjsXmE0Z/YYFKcMwY+86RYbR1PRyUC2Qe ir8VB9zTtsfm1VBuuXJkVW+vIxeksCTNR1iq8ED+8MfYLGLZA6hOiY6cfHI1Zdi6mvhKpS8 k1lC1eCv28win1HFt2ygP/C8kXlee+dDXL8IpN2dDfIPhol+Ntxj/sB2MSSQiVcQsXC1oOq bMKdsigTttCymWLpFwI6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:UoE+eMlFFis=:dN813VDjS248xE8+mhqC60 UiiSX1caYZi35hFTbiWcwAV0xLP++itQYrCHMX54j/GYfV/2dGhtteoJJkvm1N4Q/zbg1wBLi BmG0EtE7qRtOgmlC93XzI/E0R3wJCxmS/DUC3B9hnsQwMLt4RvsYMa2iTUK8Yqw3whzBFWUQC Owk1ExBuHSx2fSB9ljYUk4tfwCZVHg/tFGK32dLlZk7UqEM+oKIU1s6MEN5Zkgnf3rPFwJorW lbq8Jx7aA+EnhWhBMjnVAZ/gOB5wEevq7TDS0W2Qwn9UPcSKfaIwR4qr+uq18OZCbhAGOBJBO tg4InladrhZ4xJobH792cuxv1HWHdGEIOugpjmX0xZQQqAZioJGnwVhkqh5HTrbVLx26SC8Qc RgR4hxwHu4TsCQYQWwFn+tyQkq3jBk9jlZfsByZEIvXyv5IT1C2jhrto011YQtB/PMmk2vDHc ndmwu4GytfnONhFYcWtfIYDRkdAN1we3KLOTEdktCJhaB8myMDDbH0DhtmZAjnpwiAjQjl+T+ 3OAxGim1oCynfoBWy63YgDMaTTOeJdsDYHY+FyIXixHkIkWfCGuzEChF2fO3oEztaYYZgVnNX ytx2WKOIyfxUMfZ/hARaB/zLw5tR2//Vc74mS/4eN8BMNAm4ehtzNWdE4/D0j5WbXk8QuZAfP N5PWnIA1y1bVP4eVHHLiNiQOAJd9UdfJjV3m79fteJ/yCeg1B2h3LNpdRpJQ7jWWJfZu/4AlR feZVKAnRXk66f2SfBnStLqmDv3ICi/Bc68NsC5xBpXyBg0EwxohoOkqkHMgqVGwSs44cj27k Received-SPF: none client-ip=212.227.126.131; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140530 Archived-At: > Le 31 oct. 2022 =C3=A0 10:45, Heime a =C3=A9c= rit : >=20 > =EF=BB=BF > ------- Original Message ------- > On Monday, October 31st, 2022 at 9:24 AM, Jean Abou Samra wrote: >=20 >=20 >>>> Le 31 oct. 2022 =C3=A0 09:59, Heime heimeborgia@protonmail.com a =C3=A9= crit : >>>=20 >>> Yes, I have got really confused about what symbols are exactly. Even >>> after reading several times. I have never seen anybody make a symbol, >>> only variables. So, what is a symbol? >>=20 >>=20 >>=20 >>=20 >> Imagine parents who are planning to have a child and decide they will cal= l it, say Deborah. They will say things like =E2=80=9CI like the name Debora= h better than Mary=E2=80=9D. Those are sentences about the names themselves,= not some children. The names don=E2=80=99t need children in order to exist a= s words. Then, the child is born and sentences like =E2=80=9CDeborah weighs 3= kg=E2=80=9D (referring to the child named Deborah) start to make sense. >>=20 >> When you do 'symbol in Lisp, this gives you a bare name, or a =E2=80=9Csy= mbol=E2=80=9D. With symbol-value, you get what value is associated with this= symbol, if any (the child with that name). But you don=E2=80=99t need a val= ue bound to the symbol (a child called Deborah) before you start using the s= ymbol itself (the name =E2=80=9CDeborah=E2=80=9D). >=20 > The Lisp manual says that a symbol is an object with a name. This can be interpreted as the correct definition, but also as a wrong defin= ition where a symbol is necessarily associated with a defined variable. Bett= er said: a symbol is an object that represents a name. > Then a variable (setq thevar 4) has an associated symbol 'thevar. > And the function "(defun thefun ()" also has an associated symbol "'thefun= ". Furthermore one can make just a symbol, let us say 'go, > which can be passed as an argument to a function "(defun mbcomplt (arg)" u= sing (mbcomplt 'go). Yes. The symbol is an object like any other (5, "foo", whatever), so what yo= u can do with an object, you can do with a symbol, including passing it as a= n argument to a function. > Then inside the function on can test > whether the symbol exists with (eq arg 'go). That is not testing whether the symbol =E2=80=9Cexists=E2=80=9D. It is testi= ng whether arg is the symbol 'go. > Even though we only have a name without a values. Is this a good basic u= nderstanding=20 > of a symbol? Apart from the last part, yes.