Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!portc02.blue.aol.com!howland.erols.net!ix.netcom.com!vfr750
From: vfr750@netcom.com (Will Hartung)
Subject: Re: Is dynamic scoping possible in scheme ?
Message-ID: <vfr750E4H689.CDF@netcom.com>
Organization: Netcom On-Line Services
X-Newsreader: NN version 6.5.0 CURRENT #9
References: <5c6fv8$12hg@uni.library.ucla.edu>
Date: Thu, 23 Jan 1997 19:02:33 GMT
Lines: 38
Sender: vfr750@netcom15.netcom.com

(3 posts from John later --- :-)
"John L. Stein" <stein@seas.ucla.edu> writes:

>STk> (define (bit x y)
>    (let () 
>      (set! x 1)
>      (set! y zz) y))
>#[undefined]
>STk> (define (blob zz)
>  (bit x y))
>#[undefined]
>STk> (blob 7)

>*** Error:
>unbound variable: zz


>This should work according to my lisp book.
>I think this is dynamic scoping

Yup! It is dynamic scoping, and you must be using an OLD Lisp/Lisp book.
Modern Common Lisp doesn't use dynamic scoping any longer. 

>But it doesn't work on my version of schem STk.
>Maybe dynamic scoping is forbidden in scheme.
>Any help greatly appreciated.

Scheme has never supported dynamic scoping. As a late comer to the
Lisp/Scheme world, I've yet to want to use dynamic scoping, and it is
my understanding that its use could introduce some truly scary bugs.
So, I'm pretty happy that we don't get to use it any longer.

Hope this helps.

-- 
Will Hartung - Rancho Santa Margarita. It's a dry heat. vfr750@netcom.com
1990 VFR750 - VFR=Very Red    "Ho, HaHa, Dodge, Parry, Spin, HA! THRUST!"
1993 Explorer - Cage? Hell, it's a prison.                    -D. Duck
