all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What's wrong with value?
@ 2003-02-06 16:50 Pascal Bourguignon
  2003-02-06 17:05 ` Barry Margolin
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Pascal Bourguignon @ 2003-02-06 16:50 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-02-07  0:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-06 16:50 What's wrong with value? Pascal Bourguignon
2003-02-06 17:05 ` 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

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.