unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Jean Abou Samra <jean@abou-samra.fr>
Cc: tomas@tuxteam.de, help-gnu-emacs@gnu.org
Subject: Re: Calling a function with undefined symbol
Date: Mon, 31 Oct 2022 10:57:06 +0000	[thread overview]
Message-ID: <qRIR05vhfDv68_l80GtKAx4JdzYHIHev7OWBNgwLUVZDImRv99_C4983FCB25QjR4QqPooCYtMAcMdNAHCOCy01asYp_YvZrvNI_z0JDahk=@protonmail.com> (raw)
In-Reply-To: <BB76B557-397A-4BEF-A0C8-28946C9299A1@abou-samra.fr>

------- Original Message -------
On Monday, October 31st, 2022 at 9:58 AM, Jean Abou Samra <jean@abou-samra.fr> wrote:


> > Le 31 oct. 2022 à 10:45, Heime heimeborgia@protonmail.com a écrit :
> > 
> > ------- Original Message -------
> > On Monday, October 31st, 2022 at 9:24 AM, Jean Abou Samra jean@abou-samra.fr wrote:
> > 
> > > > > Le 31 oct. 2022 à 09:59, Heime heimeborgia@protonmail.com a écrit :
> > > > 
> > > > 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?
> > > 
> > > Imagine parents who are planning to have a child and decide they will call it, say Deborah. They will say things like “I like the name Deborah better than Mary”. Those are sentences about the names themselves, not some children. The names don’t need children in order to exist as words. Then, the child is born and sentences like “Deborah weighs 3kg” (referring to the child named Deborah) start to make sense.
> > > 
> > > When you do 'symbol in Lisp, this gives you a bare name, or a “symbol”. With symbol-value, you get what value is associated with this symbol, if any (the child with that name). But you don’t need a value bound to the symbol (a child called Deborah) before you start using the symbol itself (the name “Deborah”).
> > 
> > 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 definition where a symbol is necessarily associated with a defined variable. Better 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)" using (mbcomplt 'go).
> 
> 
> 
> 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.
> 
> > Then inside the function on can test
> > whether the symbol exists with (eq arg 'go).
> 
> 
> 
> That is not testing whether the symbol “exists”. It is testing whether arg is the symbol 'go.

Thank you for the clarification.  I now understand it.
 
> > Even though we only have a name without a values. Is this a good basic understanding
> > of a symbol?
> 
> 
> 
> Apart from the last part, yes.
 
Great, thank you.



  reply	other threads:[~2022-10-31 10:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31  8:15 Calling a function with undefined symbol Heime
2022-10-31  8:32 ` Jean Abou Samra
2022-10-31  8:42 ` tomas
2022-10-31  8:57   ` Heime
2022-10-31  9:07     ` tomas
2022-10-31  9:24     ` Jean Abou Samra
2022-10-31  9:43       ` Heime
2022-10-31  9:58         ` Jean Abou Samra
2022-10-31 10:57           ` Heime [this message]
2022-10-31 17:00           ` [External] : " Drew Adams
2022-10-31 17:10             ` Emanuel Berg
2022-11-01  4:11               ` Drew Adams
2022-11-01  5:24               ` tomas
2022-11-01 15:58                 ` Drew Adams
2022-11-01 16:13                   ` tomas
2022-11-01 19:22                     ` Drew Adams
2022-10-31 12:29   ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-31 15:37     ` Emanuel Berg
2022-11-02 12:14     ` Michael Heerdegen
2022-11-02 14:25       ` Sam Steingold
2022-11-02 16:40         ` Michael Heerdegen
2022-11-02 17:28           ` Emanuel Berg
2022-11-02 23:04           ` Emanuel Berg
2022-11-03 11:09             ` Michael Heerdegen
2022-11-03 12:15               ` Emanuel Berg
2022-11-04 12:16                 ` Michael Heerdegen
2022-11-05 14:32                   ` Emanuel Berg
2022-11-05 23:22                     ` Michael Heerdegen
2022-11-06 20:17                       ` Emanuel Berg
2022-11-07 16:03                         ` Michael Heerdegen
2022-11-07 16:50                           ` [External] : " Drew Adams
2022-11-07 16:52                           ` Emanuel Berg
2022-11-08 15:52                             ` Michael Heerdegen
2022-11-08 19:15                               ` tomas
2022-11-08 19:57                                 ` Michael Heerdegen
2022-11-08 20:47                                   ` tomas
2022-11-08 21:35                               ` Sam Steingold
2022-11-08 23:53                                 ` Michael Heerdegen
2022-11-09 15:32                                   ` Sam Steingold
2022-11-09 15:59                                     ` Michael Heerdegen
2022-11-16 19:07                               ` Emanuel Berg
2022-11-16 21:40                                 ` [External] : " Drew Adams
2022-11-16 21:55                                   ` Emanuel Berg
2022-11-04 14:33                 ` Michael Heerdegen
2022-11-05 12:57                   ` Emanuel Berg
2022-10-31 11:34 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='qRIR05vhfDv68_l80GtKAx4JdzYHIHev7OWBNgwLUVZDImRv99_C4983FCB25QjR4QqPooCYtMAcMdNAHCOCy01asYp_YvZrvNI_z0JDahk=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jean@abou-samra.fr \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).