guile-devel
[Top][All Lists]
Advanced

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

Re: expression


From: Andy Wingo
Subject: Re: expression
Date: Thu, 24 Jun 2010 15:05:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hi,

On Thu 24 Jun 2010 09:52, Michael Lucy <address@hidden> 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 via email to

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