From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Calling a function with undefined symbol Date: Mon, 31 Oct 2022 10:57:06 +0000 Message-ID: References: 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="32048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomas@tuxteam.de, help-gnu-emacs@gnu.org To: Jean Abou Samra Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 11:57:54 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 1opSUL-0008BY-Sk for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 11:57:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opSTr-0002gL-8V; Mon, 31 Oct 2022 06:57:24 -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 1opSTp-0002g8-Oc for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 06:57:21 -0400 Original-Received: from mail-4325.protonmail.ch ([185.70.43.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opSTn-00024J-Pn for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 06:57:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1667213836; x=1667473036; bh=7U1UsLNrtYQraQR4/aOTARcJzzki9kvh0J8bsrJJ0q0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=fQKgR81b2mwFsf2XeJpBBb69nWYehjuXz9by2dZiJAPWaHjXJdormXhO7O9hy/7fi toli0b7mX2iU2rOm366TRJYTsm84mS4DlS81T/mnSVO0wuvUmmUBGUqJS46SHtTXFB bIY1/BcBpdIj14DpaM1LHa8SWXhdN/5AdklVTh00yIzijsvp8YGS67u7pBijUnQg9z FcIMRUlb7nDitm76Tqx39M9P2wY4rJ2WmJAuJ/AuMevE7O87I1D6QhO4Cwt5TUsXC+ WCnVFqUUlrcEizOihQh7V7xO4QQkxOm55ja5D0tT26Y9IgSfETe42HGUjUuNJyixtw +fjAc+mjip10g== In-Reply-To: Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.25; envelope-from=heimeborgia@protonmail.com; helo=mail-4325.protonmail.ch 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, SPF_HELO_PASS=-0.001, SPF_PASS=-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:140532 Archived-At: ------- Original Message ------- On Monday, October 31st, 2022 at 9:58 AM, Jean Abou Samra wrote: > > Le 31 oct. 2022 =C3=A0 10:45, Heime heimeborgia@protonmail.com a =C3= =A9crit : > >=20 > > ------- Original Message ------- > > On Monday, October 31st, 2022 at 9:24 AM, Jean Abou Samra jean@abou-sam= ra.fr wrote: > >=20 > > > > > Le 31 oct. 2022 =C3=A0 09:59, Heime heimeborgia@protonmail.com a = =C3=A9crit : > > > >=20 > > > > Yes, I have got really confused about what symbols are exactly. Eve= n > > > > after reading several times. I have never seen anybody make a symbo= l, > > > > only variables. So, what is a symbol? > > >=20 > > > Imagine parents who are planning to have a child and decide they will= call it, say Deborah. They will say things like =E2=80=9CI like the name D= eborah better than Mary=E2=80=9D. Those are sentences about the names thems= elves, not some children. The names don=E2=80=99t need children in order to= exist as words. Then, the child is born and sentences like =E2=80=9CDebora= h weighs 3kg=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=9Csymbol=E2=80=9D. With symbol-value, you get what value is associat= ed with this symbol, if any (the child with that name). But you don= =E2=80=99t need a value bound to the symbol (a child called Deborah) before= you start using the symbol itself (the name =E2=80=9CDeborah=E2=80=9D). > >=20 > > The Lisp manual says that a symbol is an object with a name. >=20 >=20 >=20 > This can be interpreted as the correct definition, but also as a wrong de= finition where a symbol is necessarily associated with a defined variable. = Better said: a symbol is an object that represents a name. >=20 > > Then a variable (setq thevar 4) has an associated symbol 'thevar. > > And the function "(defun thefun ()" also has an associated symbol "'the= fun". Furthermore one can make just a symbol, let us say 'go, > > which can be passed as an argument to a function "(defun mbcomplt (arg)= " using (mbcomplt 'go). >=20 >=20 >=20 > Yes. The symbol is an object like any other (5, "foo", whatever), so what= you can do with an object, you can do with a symbol, including passing it = as an argument to a function. >=20 > > Then inside the function on can test > > whether the symbol exists with (eq arg 'go). >=20 >=20 >=20 > That is not testing whether the symbol =E2=80=9Cexists=E2=80=9D. It is te= sting whether arg is the symbol 'go. Thank you for the clarification. I now understand it. =20 > > Even though we only have a name without a values. Is this a good basic = understanding > > of a symbol? >=20 >=20 >=20 > Apart from the last part, yes. =20 Great, thank you.