From: Pascal Bourguignon <pjb@informatimago.com>
Subject: What's wrong with value?
Date: 06 Feb 2003 17:50:52 +0100 [thread overview]
Message-ID: <871y2l73pv.fsf@thalassa.informatimago.com> (raw)
What's happening with this symbol:
(setq value :toto) ;; C-x C-e, :toto appears in Mini-buffer.
(show value) ;; But value has not been assigned!
==> nil
(progn (setq value :toto)
(show value)) ;; well, here yes it's assigned !
==> :toto
(show value) ;; but not here !?!? What's happening?
==> nil
(show (assoc 'value (buffer-local-variables)))
==> nil
(show (version))
==> "GNU Emacs 21.2.1 (i686-pc-linux-gnu, X toolkit)
of 2002-10-26 on thalassa"
(defun show (&rest x)
"Insert the formated value X."
(unless (= (point) (progn (beginning-of-line) (point)))
(end-of-line)
(insert "\n"))
(insert (format "==> %S\n"
(if (= 1 (length x)) (car x) x)))
(if (= 1 (length x)) (car x) x)
);;show
(progn
(setq key 'ListenAddress)
(setq value '("127.0.0.3" . 25002))
(show value)
(show (symbol-value 'value))
(show (symbol-function 'value))
(show (symbol-plist 'value))
(show (assoc 'value (buffer-local-variables)))
(show (format "%-30s %s port %s\n" key (car value) (cdr value)))
)
==> ("127.0.0.3" . 25002)
==> ("127.0.0.3" . 25002)
==> (lambda (&rest local-args) "Retrieves the slot `value' from an object of class `AEToken'" (eieio-generic-call (quote value) local-args))
==> (eieio-generic t eieio-method-tree [nil nil ((AEToken lambda (this) "Retrieves the slot `value' from an object of class `AEToken'" (eieio-oref this (quote value)))) nil nil nil nil] eieio-method-obarray [[0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 AEToken 0 0] [0 0 0 0 0 0 0 0 0 0 0] nil nil nil] setf-method (lambda (widget) (block value (let* ((--widget--temp-- (gensym "--widget--")) (--store--temp-- (gensym "--store--"))) (list (list . #1=(--widget--temp--)) (list widget) (list --store--temp--) (let* ((widget --widget--temp--) (store --store--temp--)) (list (quote eieio-oset) widget (quote (quote value)) store)) (list (quote value) . #1#))))))
==> nil
==> "ListenAddress 127.0.0.3 port 25002
"
(show (symbol-value 'value))
==> nil
(show (symbol-function 'value))
==> (lambda (&rest local-args) "Retrieves the slot `value' from an object of class `AEToken'" (eieio-generic-call (quote value) local-args))
(show (symbol-plist 'value))
==> (eieio-generic t eieio-method-tree [nil nil ((AEToken lambda (this) "Retrieves the slot `value' from an object of class `AEToken'" (eieio-oref this (quote value)))) nil nil nil nil] eieio-method-obarray [[0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 AEToken 0 0] [0 0 0 0 0 0 0 0 0 0 0] nil nil nil] setf-method (lambda (widget) (block value (let* ((--widget--temp-- (gensym "--widget--")) (--store--temp-- (gensym "--store--"))) (list (list . #1=(--widget--temp--)) (list widget) (list --store--temp--) (let* ((widget --widget--temp--) (store --store--temp--)) (list (quote eieio-oset) widget (quote (quote value)) store)) (list (quote value) . #1#))))))
(show (assoc 'value (buffer-local-variables)))
==> nil
(show (format "%-30s %s port %s\n" key (car value) (cdr value)))
==> "ListenAddress nil port nil
"
Note that while 'value is a method defined with eieio, it's not the
only one and other don't have this problem:
(setq generate-conf :titi)
(show generate-conf)
==> :titi
(show (symbol-plist 'generate-conf))
==> (eieio-generic t eieio-method-tree [nil nil ((Generic . #[(self) "\303\304\305\b!\"\303\306\305\b!\"\x19\x1a\307
\310\"\210\212\311 !\210\312 \210\313\314\b!!c\210\315\316!\210\317p!\210\320\316!+\207" [self conf-file etc-dir format "%s/etc" instance-dir "%s/etc/avmailgate.conf" make-directory t find-file erase-buffer generate-configuration config save-buffer 0 kill-buffer sleep] 5 "
DO: Writes the avmailgate.conf file for this test case.
"])) nil nil nil nil] eieio-method-obarray [[0 0 0 0 0 0 0 0 0 0 0] [0 Avgated-listen 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 Avgated-listen 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Generic 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 Avgated-listen 0 0 0 0 0 0 0 0 0] nil nil nil])
--
__Pascal_Bourguignon__ http://www.informatimago.com/
----------------------------------------------------------------------
There is a fault in reality. Do not adjust your minds. -- Salman Rushdie
next reply other threads:[~2003-02-06 16:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-06 16:50 Pascal Bourguignon [this message]
2003-02-06 17:05 ` What's wrong with value? Barry Margolin
2003-02-06 17:44 ` Jesper Harder
2003-02-06 18:28 ` David Kastrup
2003-02-06 20:31 ` Pascal Bourguignon
2003-02-06 18:47 ` Greg Hill
[not found] ` <mailman.1580.1044557265.21513.help-gnu-emacs@gnu.org>
2003-02-06 20:44 ` Pascal Bourguignon
2003-02-07 0:07 ` Greg Hill
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=871y2l73pv.fsf@thalassa.informatimago.com \
--to=pjb@informatimago.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.
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.