Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!hookup!swrinde!howland.reston.ans.net!news.sprintlink.net!pipex!uknet!festival!dcs.ed.ac.uk!bojh
From: bojh@dcs.ed.ac.uk (Benjamin Hammond)
Subject: problem with R4RS letrec definition
Message-ID: <D32Gn3.H0@dcs.ed.ac.uk>
Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
Organization: Department of Computer Science, University of Edinburgh
Date: Fri, 27 Jan 1995 13:40:14 GMT
Lines: 37

I made a posting yesterday about how, strictly speaking, the rewrite
rule for letrec produced a malformed let statement.

I gave two possible fixes for this problem. The first fix I gave had the
same flaw as the original definition.

After scratching my head a bit, I've come up with this alternate rule.

(letrec ((<variable1> <init1>)
	...
	)
   <body>
)

=

(let ((<variable1> <undefined>)
      ...
     )
   (let ((<temp1> <init1>)
         ...
        )
      (set! <variable1> <temp1>)
      ...
   )
   (let () <body>)
)

My extremely pedantic parser seems to like this, and I do not think the 
meaning of the statement is changed.

Is there anyone out there who is into the grammar intricacies of the 
Revised (4) Report on Scheme who could comment.
If you could see any glaring mistakes in the above, I'd really like to 
know {:-)

Cheers.
