From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Why does assq fail when getting quoted value from a property list?
Date: Mon, 6 Aug 2018 09:29:36 +0200 [thread overview]
Message-ID: <20180806072936.GA29487@tuxteam.de> (raw)
In-Reply-To: <CADq_+R3yzagmpN76GGc0LYJAo2=P65PZDGXp7TdLEAkZ1iGf8A@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, Aug 05, 2018 at 10:55:05PM -0500, Cody Goodman wrote:
> This returns (urgent . 2) as I'd expect:
>
> (assq 'urgent '((urgent . 2)))
>
> Why does this not return the same?
>
> (let ((lookup (plist-get '(:severity (quote urgent)) :severity)))
> (assq lookup '((urgent . 2))))
Because the value of (plist-get '(:severity (quote urgent) :severity)
is the symbol 'urgent (and not the symbol urgent, as you probably expect).
IOW, '(:severity (quote urgent) :severity) is quoting the 'urgent twice,
so to speak (one is the outer '(...), the other is the inner, explicit
(quote ...)
HTH
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAltn+OAACgkQBcgs9XrR2kZMwwCggb8mFi/3CKrlpETxudgZbW6A
mVUAn1jcBAQ/1UWNNNkzLaBhelZRqGlF
=56TD
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2018-08-06 7:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 3:55 Why does assq fail when getting quoted value from a property list? Cody Goodman
2018-08-06 7:29 ` tomas [this message]
2018-08-06 11:53 ` Noam Postavsky
2018-08-06 13:27 ` tomas
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=20180806072936.GA29487@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@gnu.org \
/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.