home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / misc / 3801 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.1 KB  |  54 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
  3. From: peter@ferranti.com (peter da silva)
  4. Subject: Re: Pointers
  5. Message-ID: <id.4W3V.ZPH@ferranti.com>
  6. Organization: Xenix Support, FICC
  7. References: <mwm.2lit@contessa.palo-alto.ca.us> <id.SJYU.I62@ferranti.com> <mwm.2mx5@contessa.palo-alto.ca.us>
  8. Date: Thu, 19 Nov 1992 20:31:07 GMT
  9. Lines: 43
  10.  
  11. In article <mwm.2mx5@contessa.palo-alto.ca.us> mwm@contessa.palo-alto.ca.us (Mike Meyer) writes:
  12. > (define name car)
  13. > (define func cdr)
  14. > (define handlers '(("plugh" . plughfunc) ... ))
  15.  
  16. Great. All the pointers are still there. Plus you've added an "address"
  17. operator (quote) instead of the indirection operator.
  18.  
  19. > Note the added comments - did I assume correctly there?
  20.  
  21. Yes.
  22.  
  23. > That loop gets turned into:
  24.  
  25. > (do ((string (getline) (getline)))
  26. >     ((or
  27. >      (null? string)
  28. >      (zero? ((lookup (firstword line) handlers) (remainder line))))))
  29.  
  30. Which is precisely the same code with all the same pointers.
  31.  
  32. All this does is change the syntax around minimally. It hasn't done anything
  33. for the semantics. Where the semantics *do* change is that lisp is a much
  34. safer language. That's got nothing to do with pointers.
  35.  
  36. > > (I will readily admit that C syntax sucks here: indirection should be a
  37. > > postfix operator:
  38.  
  39. > Actually, there's no need for the indirection *at all* for any use of
  40. > C function pointers.
  41.  
  42. Well, yes, but I'm talking in the general case. In any case, ANSI C has turned
  43. (...) into an indirection operator, though they had to leave the explicit
  44. indirection in the declaration. Personally, I prefer the older semantics
  45. because it made the language more symmetrical and comprehensible (yes, the
  46. extra indirection operator made the language clearer: some people don't
  47. like the parens in lisp, but they sure make the syntax and semantics closer
  48. than in (say) Logo).
  49. -- 
  50. Peter da Silva / 77487-5012 USA / +1 713 274 5180
  51. true(<<VV$@\\$'&O 9$O%'$LT$&$"V6"$&$<4$?'&$ #I&&?$=$<<@)24 24 scale 3 21 moveto
  52. {dup 36 eq{pop not}{dup 7 and 4 sub exch 56 and 8 div 4 sub 2 index{rlineto}{
  53. rmoveto}ifelse}ifelse}forall stroke pop showpage % Har du kramat din varg idag?
  54.