From: Hattuari <susudata@setidava.kushan.aa>
Subject: Re: What is the type of user input?
Date: Fri, 29 Oct 2004 01:54:36 -0400 [thread overview]
Message-ID: <baWdnYSVZZECRhzcRVn-qQ@speakeasy.net> (raw)
In-Reply-To: 2uclntF28kv0vU1@uni-berlin.de
Kevin Rodgers wrote:
> Hattuari wrote:
> > Kevin Rodgers wrote:
> >>gl-type is a string. Since the paste-gl-type-map property list is
> >>keyed by symbols, plist-get returns nil.
> >
> > That's what I was missing. I was assuming that 'symbol-name implicitly
> > meant symbol would evaluate to a string. Now that I've read the first
> > several chapters of the Elisp Reference Manual, I have a better idea of
> > what's going on.
>
> 'foo is equivalent to (quote foo), which is the symbol whose name is
> "foo".
That's what the book says.
> > I opted for trying an association array, which also worked.
>
> I assume you mean association list.
Yes. I'm accustomed to thinking in terms of associative arrays, and I guess
force of habit got the better of me.
> But whether you have a (KEY-1
> VALUE-1 ... KEY-N VALUE-N) property list where they keys are by
> definition symbols or a ((KEY-1 . VALUE-1) ... (KEY-N . VALUE-N)) alist
> where the keys can be arbitrary lisp objects,
Actually, according to the documentation the key can be
,----[ §8.4 Property Lists ]
| The property names and values in a property list can be any Lisp
| objects, but the names are usually symbols.
`----
> you still have to make
> sure that you pass a key of the correct type to plist-get or assoc,
> respectively.
In the case of plists I guess that's a direct consequence of the requirement
that the key used for lookup has to be the actual object used as the key in
the plist.
> > I will try your suggestion of using (intern gl-type). As for reading
> > gl-type with %S, I'm not sure what that would do for me. The only use
> > I know for that is to use it in a string format.
>
> Oops, I meant S. (You used s in the interactive spec to read gl-type as
> a string; using S would bind gl-type to the intern'ed symbol.)
Can you provide a reference in the documentation where this use of 'S' is
described? The only places I'm aware of where 'S' is used as a means of
handling data associated with interactive forms is in formatting strings.
> > That doesn't tell me anything that I see as addressing my problem.
> Can you
> > explain how that answers my question as to why the two symbols were not
> > comparing as I had expected?
>
> You assumed that since the symbol and the string looked the same when
> displayed in the echo area by (message "%s" ...), that they were
> actually the same.
No. What I assumed is that a quoted symbol would evaluate to a string when
looking for keys in a plist.
--
p->m == (*p).m == p[0].m
next prev parent reply other threads:[~2004-10-29 5:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-27 10:51 What is the type of user input? Hattuari
2004-10-27 20:36 ` Kevin Rodgers
2004-10-28 12:34 ` Hattuari
2004-10-28 16:40 ` Kevin Rodgers
2004-10-29 5:54 ` Hattuari [this message]
2004-10-29 10:28 ` Johan Bockgård
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=baWdnYSVZZECRhzcRVn-qQ@speakeasy.net \
--to=susudata@setidava.kushan.aa \
/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).