help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's wrong with value?


From: Pascal Bourguignon
Subject: Re: What's wrong with value?
Date: 06 Feb 2003 21:31:11 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

David Kastrup <dak@gnu.org> writes:

> Jesper Harder <harder@myrealbox.com> writes:
> 
> > Pascal Bourguignon <pjb@informatimago.com> writes:
> > 
> > > 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
> > >
> > > Note that  while 'value is a  method defined with eieio
> > 
> > I don't think eieio is the culprit.
> > 
> > Try it with a clean 'emacs -q --no-site-file' -- the same thing happens.
> > Very mysterious!
> 
> (defun eval-last-sexp (eval-last-sexp-arg-internal)
>   "Evaluate sexp before point; print value in minibuffer.
> Interactively, with prefix argument, print output into current buffer."
>   (interactive "P")
>   (if (null eval-expression-debug-on-error)
>       (eval-last-sexp-1 eval-last-sexp-arg-internal)
>     (let ((old-value (make-symbol "t")) new-value value)
>       (let ((debug-on-error old-value))
>       (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))
>       (setq new-value debug-on-error))
>       (unless (eq old-value new-value)
>       (setq debug-on-error new-value))
>       value)))

Yes,  I thought  about something  like  that.  Hence  the interest  of
lexical scoping of Common-Lisp...

Thank you.

-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
There is a fault in reality. Do not adjust your minds. -- Salman Rushdie


reply via email to

[Prev in Thread] Current Thread [Next in Thread]