[plt-scheme] Unnecessary use of letrec?

From: Dan Farina (drfarina at berkeley.edu)
Date: Fri Jun 15 03:23:30 EDT 2007

On Thu, 2007-06-14 at 23:26 -0500, Grant Rettke wrote:
> I wrote some code:
>  (letrec ([pos (file-start-position editor)]
>             [loaded (load-file editor)])
> where I wanted to be sure that pos gets defined before the file is
> loaded. I read that letrec runs left to right, so I used that. The
> defintions are not recursive.

> It seems I could replace this letrec with let and be guaranteed the
> same behavior?

I think what you want is "let*" (pronounced let-star)


Posted on the users mailing list.