home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.perl:7061 comp.lang.scheme:2610 comp.lang.tcl:1890
- Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf
- From: markf@zurich.ai.mit.edu (Mark Friedman)
- Newsgroups: comp.lang.perl,comp.lang.scheme,comp.lang.tcl
- Subject: Re: Closures, Object-Oriented Equivalence, New version of Perl and TCL
- Date: 19 Nov 92 11:14:56
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 47
- Message-ID: <MARKF.92Nov19111456@montreux.ai.mit.edu>
- References: <9211110521.AA01343@cs.columbia.edu> <9211180509.AA04035@cs.columbia.edu>
- Reply-To: markf@zurich.ai.mit.edu
- NNTP-Posting-Host: montreux.ai.mit.edu
- In-reply-to: thayer@cs.columbia.edu's message of Wed, 18 Nov 92 00:09:50 EST
-
- In article <9211180509.AA04035@cs.columbia.edu> thayer@cs.columbia.edu (Charles Thayer) writes:
-
- ** > For example, in Scheme, a 'define' saves the current environment and
- ** > leaves the ability to reach the enclosing (dynamic) environment:
- **
- ** That's not quite right. DEFINE does not save the current environment.
- ** It only binds a value to a variable.
- **
- ** I was not refering to the scheme meaning of `environment'. I meant
- ** the entire set of visible bindings. In scheme the `environment' only
- ** holds the most immediate visible bindings.
-
- I think that the distinction that the responder wanted to make was
- that DEFINE does no saving of any kind of environment at all. DEFINE
- is just a binding construct.
-
- ** :) Which brings up an interesting point in mit-scheme:
- **
- ** (begin
- ** (define a "moo")
- ** (define (foo)
- ** (display a)
- ** (define a "bar")
- ** )
- ** (foo))
- **
- ** => Unassigned variable a
-
- The code above is not legal Scheme. Internal defines must precede the
- body of procedure being defined.
-
- ** Astute PERL users will notice that there are similar holes in the
- ** implementation of the exact same thing with respect to the main
- ** package :) which I find ironic.
-
- This is not an implementation hole in Scheme. It is a language design
- issue. The above code (if legal) would have an ambiguity which the
- Scheme designers chose to solve by making it illegal.
-
- -Mark
- --
-
- Mark Friedman
- 42 Wyatt St.
- Somerville, Ma. 02143
-
- markf@zurich.ai.mit.edu
-