home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf
- From: markf@zurich.ai.mit.edu (Mark Friedman)
- Newsgroups: comp.lang.scheme
- Subject: Re: Closures, Object-Oriented Equivalence, New version of Perl and TCL
- Date: 23 Nov 92 15:25:37
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 55
- Message-ID: <MARKF.92Nov23152537@montreux.ai.mit.edu>
- References: <9211110521.AA01343@cs.columbia.edu> <9211180509.AA04035@cs.columbia.edu>
- <9211222151.AA09161@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 Sun, 22 Nov 92 16:51:02 EST
-
- In article <9211222151.AA09161@cs.columbia.edu> thayer@cs.columbia.edu (Charles Thayer) writes:
-
- ** Likewise, I was reminding:
- **
- ** (begin
- ** (define a "moo")
- ** (define (foo)
- ** (define BASE_a a) ;; nope
- ** (define a "bar") ;; nope
- ** (display a)
- ** )
- ** (foo))
-
- I don't really understand what the point of this example is. If you
- want the 'a' in "(define BASE_a a)" to refer to the outer 'a' you can
- do (for example):
-
- (begin
- (define a "moo")
- (define (foo)
- (define BASE_a a) ;; yep
- (let ((a "bar")) ;; yep
- (display a)))
- (foo))
-
- If you want the 'a' to refer to the 'a' that you've defined in FOO then
- you can do (for example):
-
- (begin
- (define a "moo")
- (define (foo)
- (let* ((a "bar") ;; yep
- (BASE_a a)) ;; yep
- (display a)))
- (foo))
-
- The fact that you can't do these things via the DEFINE syntax doesn't
- seem to be very important.
-
- -Mark
-
- ** With the same disclaimer, there are languages that have chosen the
- ** other path, and have traded efficiency to be more dynamic.
-
- What are the two paths again? I must have missed (or forgotten) the
- beginning of this thread.
-
- -Mark
- --
-
- Mark Friedman
- 42 Wyatt St.
- Somerville, Ma. 02143
-
- markf@zurich.ai.mit.edu
-