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

  1. Path: sparky!uunet!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: *READ-SUPPRESS* and #P syntax
  5. Date: 18 Nov 1992 19:14:16 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 70
  8. Message-ID: <1ee4m8INNbmt@early-bird.think.com>
  9. References: <1992Nov15.210151.1062@wstar.mixcom.com> <1e934iINNaod@early-bird.think.com> <1992Nov18.000646.1180@wstar.mixcom.com>
  10. NNTP-Posting-Host: telecaster.think.com
  11.  
  12. In article <1992Nov18.000646.1180@wstar.mixcom.com> jpf@wstar.mixcom.com (John P. Flanagan) writes:
  13. >barmar@think.com (Barry Margolin) writes:
  14. >>My interpretation of *READ-SUPPRESS* is that when it doesn't say something
  15. >>operates differently from normal, it should operate the normal way.  Thus,
  16. >
  17. >Maybe it's the cloudy weather affecting my judgement, but since nearly
  18. >all sharp reader macros behave a certain way when *read-suppress* is
  19. >non-nil, why then would you assume that a sharp reader macro that slipped
  20. >through the specification net wouldn't behave in a similar manner?
  21.  
  22. I based my assumption on the fact that CLtL and the dpANS specifically list
  23. only a small number of sharpsign macros in the the description of
  24. *READ-SUPPRESS*, and make no mention of a general default effect of setting
  25. this variable.  When interpreting a language standard (AKA "language
  26. lawyering"), it's generally not appropriate to extrapolate from specific
  27. instances to general cases.
  28.  
  29. >Normally these two expressions produce a vector of two elements, the symbols
  30. >foo and bar, but when *read-suppress* is non-nil we get this instead?
  31. >
  32. >    #1A(foo bar)
  33. >    => nil
  34. >
  35. >    #(foo bar)
  36. >    => #(nil nil)
  37. >
  38. >Isn't this a bit inconsistent (if not confusing)?
  39.  
  40. I agree that it's inconsistent and confusing, but I also believe it's
  41. implied by CLtL.
  42.  
  43. >>#( continues to construct vectors because it doesn't say that it doesn't.
  44. >>Notice that when it's describing (, the words "and construct" are in
  45. >                                                ^^^^^^^^^^^^^
  46. >                        In Draft 12.24, X3J13/92-102
  47. >                        this is not in parentheses.
  48.  
  49. Good point.  I think that was a mistake by the draft editor, although I can
  50. see how he might not consider the parentheses to imply a technical
  51. distinction.  Assuming my interpretation of CLtL is correct, this would be
  52. a technical change that was never voted on by X3J13 (except insofar as we
  53. gave a blanket approval to submit the draft for public review).
  54.  
  55. >>parentheses.  I interpret this to mean that it's just stating the obvious;
  56. >>it wasn't repeated in the following sentence because it's even more obvious
  57. >>because it was stated explicitly but parenthetically in the previous
  58. >>sentence.
  59. >
  60. >Evidently others (besides me) do not share this interpretation, e.g.,
  61. >CMU returns nil instead of a vector.  If you're saying that the #(
  62. >notation should continue to construct vectors partly because the (
  63. >notation does, but mostly because it doesn't say not to, in spite of the
  64. >fact that the more similar #A notation doesn't, well, I'll wait for the
  65. >book (or the movie) to come out, maybe I'll understand it then.  ;-)
  66.  
  67. Actually, I'm considering suggesting a more general change:
  68.  
  69.     When *READ-SUPPRESS* is true, READ, READ-PRESERVING-WHITESPACE, and
  70.     READ-DELIMITED-LIST all return NIL; however, they continue to parse the
  71.     representation of an object in the normal way, in order to skip over
  72.     the object.  Any standard read macro that is defined to read an object
  73.     or token will do so, but not signal an error if the object read is not
  74.     of an appropriate type or syntax.
  75.  
  76. Sound reasonable?
  77. -- 
  78. Barry Margolin
  79. System Manager, Thinking Machines Corp.
  80.  
  81. barmar@think.com          {uunet,harvard}!think!barmar
  82.