From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: What's wrong with value? Date: 06 Feb 2003 17:50:52 +0100 Organization: informatimago.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <871y2l73pv.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1044550560 5512 80.91.224.249 (6 Feb 2003 16:56:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Feb 2003 16:56:00 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18gpJc-0001QS-00 for ; Thu, 06 Feb 2003 17:55:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18gpJD-0006yn-02 for gnu-help-gnu-emacs@m.gmane.org; Thu, 06 Feb 2003 11:55:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!thalassa.informatimago.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 81 Original-NNTP-Posting-Host: thalassa.informatimago.com (212.87.205.57) Original-X-Trace: fu-berlin.de 1044550255 41219503 212.87.205.57 (16 [41911]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:109870 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6375 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6375 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!\"\303\306\305!\"\307 \310\"\210\212\311 !\210\312 \210\313\314!!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