unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Michael Lucy <MichaelGLucy@Gmail.com>
Cc: Ken Raeburn <raeburn@raeburn.org>, guile-devel@gnu.org
Subject: Re: expression
Date: Thu, 24 Jun 2010 15:05:38 +0200	[thread overview]
Message-ID: <m3hbks7f8d.fsf@pobox.com> (raw)
In-Reply-To: <AANLkTimNBbhJWnSWewhL6n1Rs7E1iSKeK5nkwLXJDGeg@mail.gmail.com> (Michael Lucy's message of "Thu, 24 Jun 2010 02:52:26 -0500")

Hi,

On Thu 24 Jun 2010 09:52, Michael Lucy <MichaelGLucy@Gmail.com> writes:

> scheme@(guile-user)> ,c (begin a b 1)
> Disassembly of #<objcode d123d28>:
>
>    0    (assert-nargs-ee/locals 0)
>    2    (load-symbol "a")               ;; a
>    7    (link-now)
>    8    (variable-ref)
>    9    (drop)
>   10    (load-symbol "b")               ;; b
>   15    (link-now)
>   16    (variable-ref)
>   17    (drop)
>   18    (make-int8:1)                   ;; 1
>   19    (return)
>
> Out of curiosity, why are variables left in?  Are there situations
> where evaluating a variable will have side-effects?

Global variable references can cause side effects (exceptions, module
autoloads, binders, duplicates handlers, etc) so they are not optimized
out. Lexical references cannot cause side effects, so they are optimized
out.

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2010-06-24 13:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 21:09 expression Michael Lucy
2010-06-23 23:14 ` expression No Itisnt
2010-06-23 23:23   ` expression Michael Lucy
2010-06-24 13:01     ` expression Andy Wingo
2010-06-24  6:55 ` expression Ken Raeburn
2010-06-24  7:27   ` expression Thien-Thi Nguyen
2010-06-24  7:52   ` expression Michael Lucy
2010-06-24 13:05     ` Andy Wingo [this message]
2010-06-24 13:03   ` expression Andy Wingo
2010-06-24 14:40     ` expression Ken Raeburn

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

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hbks7f8d.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=MichaelGLucy@Gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=raeburn@raeburn.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).