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

Marius Vollmer (mvo@zagadka.ping.de)
16 Aug 1998 15:17:07 +0200

hjstein@bfr.co.il (Harvey J. Stein) writes:

> In particular, the following is illegal, but both guile & STk allow
> it:
> guile> (define (f x y)
> (define r1 (* x y))
> (define r2 (* 2 r1))
> (list r1 r2))

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))

(foo 1 2)
=> #<procedure bar ()> ;; OOPS - should be 2

So don't fo this. Ideally, Guile should produce a error for this, at
least the debugging evaluator.