From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Calling a function with undefined symbol Date: Mon, 31 Oct 2022 09:42:53 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAS0jYvAhr4a1kG7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35900"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 09:43:32 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 1opQOK-0009Bt-7Q for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 09:43:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opQNr-0000j2-Fk; Mon, 31 Oct 2022 04:43:04 -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 1opQNn-0000ia-Ic for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 04:42:59 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opQNl-0003ex-JA for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 04:42:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=eX8iugB/f6LRkbn82EwnrYN9JF0Ba3SC8IakL507qq4=; b=g8ZoLJH+sSRhMCD/XbqAUx+JR/ L8Ats+Y5VR7EK+1Npvh1hOYhGGv3Pl/Ht/oxZztHlKdE3B0N1FeUpay9O4CWp8gF1h7QX4bIGp/az wKE4DeXxmBtYN7v/+zaPUkYLKzg/Wkt882qmrZgIhdfS9S9Y5kxvW7WVOzwR6xzqZjZWub9WuMXfF zKqARBdcm+ZJZQlGzV2nNAtwTDcJuAwBOTfr/1X+X1dAH1S14ZCGXdWNaiq9cH0lrmAOfkMCHPVfM FViCfHQaGQN2nfL+hzWwpxiQidzd8AGoo1KT+OXzMody65aasoIOohZhNwrLCKGiQZxiekbQl+TAg Mm7T73rA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1opQNh-0001cF-E5 for help-gnu-emacs@gnu.org; Mon, 31 Oct 2022 09:42:53 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, SPF_HELO_NONE=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:140525 Archived-At: --eAS0jYvAhr4a1kG7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 31, 2022 at 08:15:32AM +0000, Heime wrote: >=20 > Have written a function named "mbcomplt" that takes a symbol. The function takes an argument, that's what it does. > (defun mbcomplt (sgnl) > "DOC." sgnl here is a variable. Or a variable name. Depending on how you look at it. > (if (eq sgnl 'go) > (message "go") > (message "nogo"))) Now you are comparing sgnl's /value/ to something (which happens to be a symbol). > I can call this function with >=20 > (mbcomplt 'go) Yes. You could call it also with (mbcomplt 23). Or (mbcomplt "This is not a= pipe"). So? > This even though the symbol "'go" does not exist. What is happening here? As soon as you do 'go, the symbol exists. > My understanding about symbols is that I can make a symbol using >=20 > (defvar seqr 3) ; set symbol seqr with value 3 No, no. You are making a variable. Which is a binding of a symbol to a value. > (setq seqr 5) ; set symbol seqr with value 5 No, you set the variable's value to 5. The symbol is not "set" to anything. It is an immutable thing, as far as Lisp is concerned. The symbol 'seqr is just taking the job of variable name here. Like you are called Heime (or whatever it is this week). That name is not you. > (symbol-value 'seqr) ; get value of symbol (returns 5) > (symbol-name 'seqr) ; get name of symbol (returns "seqr") Symbol-value returns the value associated to the symbol. The association itself is called a "variable". Please go re-read the manuals. You have got all of it confused :) Cheers --=20 t --eAS0jYvAhr4a1kG7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY1+KhwAKCRAFyCz1etHa RibFAJ0a7fofAsruGCgYJc3CDdb2apG6gQCdGpDZOfnAUgyGJLrSk6TUyXKVfc8= =3M59 -----END PGP SIGNATURE----- --eAS0jYvAhr4a1kG7--