This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Here's a guile profiling tool/a question/a *remarkable* guile fact (was Re: Guile profiling tools?)


Marius Vollmer <mvo@zagadka.ping.de> writes:

> When you take this a few steps further, you can actually cause Guile
> (and SCM I think) to loose:
> 
>     (define (f x y)
>       (define r1 (* x y))
>       (define (bar)
> 	r1)
>       (define r2 (* 2 (bar)))
>       (bar))
> 
>     (f 1 2)
>     => #<procedure bar ()>   ;; OOPS - should be 2


The above is an error:  evaluating R2 requires the values of BAR and
hence R1.  SCM did lose on this until recently, it now actually
rewrites internal DEFINE to LETREC.