home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / scheme / 2635 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.8 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf
  2. From: markf@zurich.ai.mit.edu (Mark Friedman)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Closures, Object-Oriented Equivalence, New version of Perl and TCL
  5. Date: 23 Nov 92 15:25:37
  6. Organization: M.I.T. Artificial Intelligence Lab.
  7. Lines: 55
  8. Message-ID: <MARKF.92Nov23152537@montreux.ai.mit.edu>
  9. References: <9211110521.AA01343@cs.columbia.edu> <9211180509.AA04035@cs.columbia.edu>
  10.     <9211222151.AA09161@cs.columbia.edu>
  11. Reply-To: markf@zurich.ai.mit.edu
  12. NNTP-Posting-Host: montreux.ai.mit.edu
  13. In-reply-to: thayer@cs.columbia.edu's message of Sun, 22 Nov 92 16:51:02 EST
  14.  
  15. In article <9211222151.AA09161@cs.columbia.edu> thayer@cs.columbia.edu (Charles Thayer) writes:
  16.  
  17. ** Likewise, I was reminding:
  18. ** 
  19. ** (begin
  20. **   (define a "moo")
  21. **   (define (foo) 
  22. **     (define BASE_a a)    ;; nope
  23. **     (define a "bar")    ;; nope
  24. **     (display a)
  25. **     )
  26. **   (foo))
  27.  
  28. I don't really understand what the point of this example is. If you
  29. want the 'a' in "(define BASE_a a)" to refer to the outer 'a' you can
  30. do (for example):
  31.  
  32. (begin
  33.   (define a "moo")
  34.   (define (foo) 
  35.     (define BASE_a a)    ;; yep
  36.     (let ((a "bar"))    ;; yep
  37.       (display a)))
  38.   (foo))
  39.  
  40. If you want the 'a' to refer to the 'a' that you've defined in FOO then
  41. you can do (for example):
  42.  
  43. (begin
  44.   (define a "moo")
  45.   (define (foo) 
  46.     (let* ((a "bar")    ;; yep
  47.            (BASE_a a))    ;; yep
  48.       (display a)))
  49.   (foo))
  50.  
  51. The fact that you can't do these things via the DEFINE syntax doesn't
  52. seem to be very important.
  53.  
  54. -Mark
  55.  
  56. ** With the same disclaimer, there are languages that have chosen the
  57. ** other path, and have traded efficiency to be more dynamic.
  58.  
  59. What are the two paths again?  I must have missed (or forgotten) the
  60. beginning of this thread.
  61.  
  62. -Mark
  63. --
  64.  
  65. Mark Friedman
  66. 42 Wyatt St.
  67. Somerville, Ma. 02143
  68.  
  69. markf@zurich.ai.mit.edu
  70.