[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why does assq fail when getting quoted value from a property list?
From: |
tomas |
Subject: |
Re: Why does assq fail when getting quoted value from a property list? |
Date: |
Mon, 6 Aug 2018 09:29:36 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----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-----