unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Dr Rainer Woitok <rainer.woitok@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: (interactive) and &optional
Date: Sat, 25 Mar 2023 13:12:48 +0000	[thread overview]
Message-ID: <87fs9t3rfz.fsf@posteo.net> (raw)
In-Reply-To: <25630.60070.913514.100455@woitok.gmail.com> (Rainer Woitok's message of "Sat, 25 Mar 2023 13:35:51 +0100")

Dr Rainer Woitok <rainer.woitok@gmail.com> writes:

> Philip,
>
> On Thursday, 2023-03-23 19:20:29 +0000, you wrote:
>
>> ...
>> > as expected,  while calling "M-x fun" and then just typing  "RET" at the
>> > prompt returns
>> >
>> >   val:.\n
>> >
>> > that is, an empty symbol or string.
>> 
>> Right.
>
> That's a bit flabbergasting: experimenting some more with my function, I
> found that "symbolp" really returns t in case of empty responses,  mean-
> ing there really is such a thing as an empty symbol.   So how can I test
> for an empty symbol?  

I am guessing it is not an "empty symbol" (to my knowledge the term is
not defined), but rather the fact that `nil' is a symbol.  Depending on
what you did, it might also be that you are interning the empty string,
which creates a symbol with an empty string as the symbol name -- which
is not unique. 

>                       There doesn't seem to be a function "symbol-empty-
> p" while, strictly speaking,  "string-empty-p" shouldn't be applyable to
> symbols at all, should it?  

No, trivially because a symbols is not a string, and shouldn't be
regarded as similar data types.  Depending on the context, it might be
totally justified to regard the symbol name of a symbol as totally
incidental.

>                             Does an empty symbol have an external repre-
> sentation like an empty list or string, allowing the use of "eq"?

A symbol is eq to all other symbols that were either created by passing
the same (equal) string to `intern' or by the same invocation of
`make-symbol'.  That could be useful if you are trying to handle a
symbol that as an empty string as the symbol name -- but at that point I
think it would be better to just check the string before it is interned.

> Sincerely,
>   Rainer

-- 
Philip Kaludercic



  reply	other threads:[~2023-03-25 13:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 19:10 (interactive) and &optional Dr Rainer Woitok
2023-03-23 19:20 ` Philip Kaludercic
2023-03-25 12:35   ` Dr Rainer Woitok
2023-03-25 13:12     ` Philip Kaludercic [this message]
2023-03-25 14:33       ` [External] : " Drew Adams
2023-03-25 15:36         ` Dr Rainer Woitok
2023-03-25 16:58         ` Philip Kaludercic
2023-03-23 20:01 ` Emanuel Berg
2023-03-24  9:23 ` Jean Louis
2023-03-24 20:52   ` Philip Kaludercic
2023-03-24 21:07     ` Emanuel Berg
2023-03-27  1:52       ` [External] : " Drew Adams
2023-03-27  2:40         ` John Yates
2023-03-24 21:42     ` Jean Louis
2023-03-26  1:04       ` Emanuel Berg
2023-03-30 19:04         ` Jean Louis
2023-03-25 12:05   ` Dr Rainer Woitok
2023-03-25 14:32     ` Jean Louis
2023-03-25 15:41       ` Dr Rainer Woitok

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=87fs9t3rfz.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rainer.woitok@gmail.com \
    /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).