all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: RE: print-circle and describe-variable
Date: Tue, 10 Apr 2007 08:50:56 -0700	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMOEIMDAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <461BAE37.9010208@gmail.com>

> >>>> But the result I see is
> >>>>
> >>>>    (#1=(2) #1#)((2) (2))
> >>>>
> >>>> Why are the two printed representations of toto different?
> >>> I think you are seeing: 1) the side-effect result of `prin1' printing,
> >>> followed by 2) the returned value, printed normally. (#1=(2)
> >>> #1#) is the former; ((2) (2)) is the latter.
> >>
> >> But it is the output of (prin1 (list toto toto)), isn't it?
> >
> > I'm not sure what you mean (by "it" and by "the output", for instance).
> >
> > During the invocation of `prin1', the `print-circle' binding is
> > in effect, so (#1=(2) #1#) is what is printed (by the side effect
> > of `prin1').
> >
> > The binding is finished after the expression evaluation, and
> > that is when the command loop prints the value that is returned
> > by the expression. Printing of this value is thus done using
> > the default value of `print-circle', nil, so you see ((2) (2)).
>
> Yes, but the let binding is in effect when printing the second toto too,
> or? The argument to print1 is (list toto toto).

I probably still don't understand what you're saying. HTH:

toto = (2)
(list toto toto) = ((2) (2))

(list toto toto) is printed twice when you eval the overall `let'
expression:

* First, by `prin1', within a context where `print-circle' = t. The printout
is (#1=(2) #1#). You don't explicitly see the value of toto printed twice
here, as (2) each time, because that's how `print-circle' works: it
represents the list without showing the normal, full representation of each
list element; it uses #1 as an abbreviation (placeholder) for the first
element, and so on.

* Second, by the command loop, in a context where `print-circle' = nil. The
printout is ((2) (2)). Here, you see the value of toto printed twice
explicitly, and it is printed the same each time.

  reply	other threads:[~2007-04-10 15:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-07  0:54 print-circle and describe-variable Lennart Borgman (gmail)
2007-04-07 17:31 ` Richard Stallman
2007-04-09  0:15   ` Stefan Monnier
2007-04-09  1:00     ` Lennart Borgman (gmail)
2007-04-09  7:02       ` Eli Zaretskii
2007-04-09  9:06         ` Lennart Borgman (gmail)
2007-04-09 19:25       ` Stefan Monnier
2007-04-09 19:59         ` Lennart Borgman (gmail)
2007-04-09 23:08           ` Chong Yidong
2007-04-09 23:28             ` Lennart Borgman (gmail)
2007-04-09 23:43               ` Drew Adams
2007-04-10  0:01                 ` Lennart Borgman (gmail)
2007-04-10 15:02                   ` Drew Adams
2007-04-10 15:33                     ` Lennart Borgman (gmail)
2007-04-10 15:50                       ` Drew Adams [this message]
2007-04-10 16:32                         ` Lennart Borgman (gmail)
2007-04-10 16:13                       ` Chong Yidong
2007-04-10  1:00           ` Miles Bader
2007-04-10  2:21         ` Richard Stallman
2007-04-10  2:35           ` Chong Yidong
2007-04-11  4:14             ` Richard Matthew Stallman
2007-04-11  5:16               ` Chong Yidong
2007-04-11 23:04                 ` Richard Matthew Stallman
2007-04-12  9:29                   ` Kim F. Storm
2007-04-13  1:41                     ` Richard Stallman
2007-05-11 16:33                 ` Herbert Euler
2007-04-09 22:52     ` Richard Stallman

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=EIENLHALHGIMHGDOLMIMOEIMDAAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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.