From: Hattuari <susudata@setidava.kushan.aa>
Subject: Re: What is the type of user input?
Date: Thu, 28 Oct 2004 08:34:54 -0400 [thread overview]
Message-ID: <bOOdnXvkxP1yeh3cRVn-iQ@speakeasy.net> (raw)
In-Reply-To: 2uaf6cF28g520U1@uni-berlin.de
Kevin Rodgers wrote:
> Hattuari wrote:
> > The following code demonstrates the problem I'm having:
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > ;; create a property list and use it to map long strings
> > ;; to short strings
> > (setq paste-gl-ty
...
> 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.
> The %s message specifier can be
> applied to any Lisp object, and symbols and strings are formatted the
> same.
>
> The solution is to either (1) read gl-type with the %S code or (2) call
> plist-get with (intern gl-type).
I opted for trying an association array, which also worked. 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.
> > OTOH, when I evaluate this expression in an emacs-lisp buffer
> > (paste-gl-array 'GLbyte 4 'v), I see the following in the echo area:
> >
> > gl-type=GLbyte, gl-components=4, gl-vector=v , suffix=b
> >
> > That is the desired result. Why is this not the result of calling the
> > function as an interactive command as described above?
> >
> > I will continue to look for an answer in the documentation, but any
> > help from someone who knows the answer would be appreciated.
>
> It's not that hard to find:
>
> `C-h f message' has a link to the doc string for `format', which has a
> link to the doc string for `princ' in its description of %s:
>
> ,----[ C-h f princ RET ]
> | princ is a built-in function.
> | (princ OBJECT &optional PRINTCHARFUN)
> |
> | Output the printed representation of OBJECT, any Lisp object.
> | No quoting characters are used; no delimiters are printed around
> | the contents of strings.
> |
> | OBJECT is any of the Lisp data types: a number, a string, a symbol,
> | a list, a buffer, a window, a frame, etc.
> |
> | A printed representation of an object is text which describes that
> | object.
> ...`----
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?
(type-of gl-type) was what showed me what I was doing wrong. I tried to
post back to the newsgroup, but my ISP was down.
--
p->m == (*p).m == p[0].m
next prev parent reply other threads:[~2004-10-28 12:34 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 [this message]
2004-10-28 16:40 ` Kevin Rodgers
2004-10-29 5:54 ` Hattuari
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bOOdnXvkxP1yeh3cRVn-iQ@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.