Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!image.soe.clarkson.edu!jk0 From: jk0@image.soe.clarkson.edu (Jason Coughlin) Newsgroups: comp.lang.scheme Subject: Non-local variables Message-ID: <1990May8.205719.2014@sun.soe.clarkson.edu> Date: 8 May 90 20:57:19 GMT References: <9005081621.AA13048@mtecv2.mty.itesm.mx> Sender: jk0@sun.soe.clarkson.edu (Jason Coughlin) Organization: Clarkson University, Potsdam, NY Lines: 35 Hi. I've got a short little example which creates a non-local variable to implement a simple little counter. In my implementation of Scheme, I create it like this: (let ([a 0]) (define counter (lambda () (set! a (+ a 1)) a ) ) ) PC-Scheme barfs on this complaining about an illegal letrec syntax. Both PC-Scheme and my Scheme allow the example in Dybvig's book, _The Scheme Programming Language_: (define counter (let ([a 0]) (lambda () (set! a (+ a 1)) a ) ) ) Am I missing something important here? -- Jason Coughlin ( jk0@sun.soe.clarkson.edu , jk0@clutx ) "Every jumbled pile of person has a thinking part that wonders what the part that isn't thinking isn't thinking of." -- They Might Be Giants "If you read the _TV Guide_, then there's no need for a TV." -- Lost Boys