Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!howland.reston.ans.net!torn!nott!cunews!alpha11!ug940095
From: ug940095@scs.carleton.ca (Bart Trojanowski)
Subject: Q: how does "letrec" work...
X-Nntp-Posting-Host: alpha11.scs.carleton.ca
Message-ID: <DMA1B9.MGH@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: School Of Computer Science, Carleton University, Canada
X-Newsreader: TIN [version 1.2 PL2]
Date: Mon, 5 Feb 1996 00:28:21 GMT
Lines: 25


why does the following code not work????

(define test 
  (lambda (x)
     (letrec
        ((z x) 
         (x 3)
         (y x))
        (+ x y z))))

My first guess was that scheme creates a new environment for letrec and does 
not give it access to any other environments, sortof like a "private" environment,
but is that realy possible?





--
--- Bart
        blacksun@magi.com                       http://infoweb.magi.com/~blacksun
        btrojano@chat.carleton.ca               http://www.chat.carleton.ca/~btrojano
        ug940095@omega.scs.carleton.ca          http://www.scs.carleton.ca/~ug940095

