home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.perl:7055 comp.lang.scheme:2608 comp.lang.tcl:1880
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!olivea!charnel!psgrain!percy!data!kend
- From: kend@data.rain.com (Ken Dickey)
- Newsgroups: comp.lang.perl,comp.lang.scheme,comp.lang.tcl
- Subject: Re^2: Closures, Object-Oriented Equivalence, New version of Perl and TCL
- Message-ID: <736@data.rain.com>
- Date: 19 Nov 92 00:56:35 GMT
- References: <9211110521.AA01343@cs.columbia.edu> <9211180509.AA04035@cs.columbia.edu>
- Organization: Microtek DSD, Hillsboro, OR
- Lines: 37
-
- thayer@cs.columbia.edu (Charles Thayer) writes:
-
- >:) Which brings up an interesting point in mit-scheme:
-
- >(begin
- > (define a "moo")
- > (define (foo)
- > (display a)
- > (define a "bar")
- > )
- > (foo))
-
- >=> Unassigned variable a
-
-
- This is because the above is equivalent to the following:
-
- (letrec ( (a "moo")
- (foo
- (lambda ()
- (display a)
- (define a "bar")) ;; <- ill-placed define
- )
- )
- (foo)
- )
-
- The semantics of "internal defines" is that of LETREC (parallel
- assignment) and
- *** definitions must occur before other expressions within a block ***
-
- This difference between "internal defines" and "top-level defines"
- has been a subject of debate for some time. I am not taking a
- position here, just trying to insure that the definition is
- understood.
-
- -Ken
-