This is the mail archive of the guile@sourceware.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]

Internal defines


Hello.

I note that internal defines are transformed to letrecs now. This is
basically good, but...

(define (f x)
  (define a (foobar x))
  (define b (baz a))
  (quux b))

...no longer works. I know that letrec isn't mandated to find immediate
interdependencies in letrec bindings. The same issue is discussed in
SICP exercise 4.19.

Anyway, I was kind of used to having sequential internal defines rely on
the previous variable having been bound before the next one's
initialization was evaluated. Was this really Bad Style, and am I better
off converting my code to use let* in these places?

I just wouldn't much like an extra level of indentation.. is there any
way to implement some kind of a define* macro that would transform the
body of a lambda into a let* expression? Or what would be the best way
to get what I want?


Lauri Alanko
la@iki.fi


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