bug-guile
[Top][All Lists]
Advanced

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

scoping problem


From: Paul Jarc
Subject: scoping problem
Date: Sat, 22 Jun 2002 17:05:45 -0400
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu)

I'm new to Scheme, so maybe this isn't a bug, but this script:
#!/usr/local/bin/guile -s
!#
(let ()
  (define x #t)
  (define y x)
  #t)

gives me this error:
ERROR: Unbound variable: x

I had thought the definition of x was supposed to be visible
throughout the body of the enclosing (let).  I can work around it like
this:
#!/usr/local/bin/guile -s
!#
(let ()
  (define x #t)
  (define y (lambda () x))
  (set! y (y))
  #t)

But if possible, I'd like to do it all in the (define) form, without
using (set!).


paul



reply via email to

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