home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pop / 164 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  4.4 KB

  1. Path: sparky!uunet!mcsun!uknet!bhamcs!axs
  2. From: axs@cs.bham.ac.uk (Aaron Sloman)
  3. Newsgroups: comp.lang.pop
  4. Subject: Re: List and Vector Syntax (long)
  5. Message-ID: <Bzo7E6.A4G@cs.bham.ac.uk>
  6. Date: 22 Dec 92 17:03:41 GMT
  7. References: <116670035@otter.hpl.hp.com>
  8. Sender: news@cs.bham.ac.uk
  9. Organization: School of Computer Science, University of Birmingham, UK
  10. Lines: 94
  11. Nntp-Posting-Host: emotsun
  12.  
  13.  
  14. sfk@otter.hpl.hp.com (Steve Knight) writes:
  15.  
  16. > Date: 16 Dec 92 17:11:54 GMT
  17. > Organization: Hewlett-Packard Laboratories, Bristol, UK.
  18. >
  19. > Continuing the thread on list and vector syntax ....
  20. > .....
  21. > The current syntax conflates two language roles -- quoting and
  22. > sequence construction.  This runs against the solid grain of orthogonality
  23. > that permeates the rest of POP-11.  Although we can conveniently build
  24. > lists and vectors with quoted contents, we cannot conveniently put
  25. > quoted items on the stack, for example.  The nearest idiom is
  26. >     cons_with erase { this is a quoted collection of words }
  27. >
  28. > My view is that these two roles can and should be separated.  In POP-11
  29. > we have too many distinct quoting contexts.  There are four quoting
  30. > contexts in POP-11:
  31. >
  32. >     "word"          a lexical word enclosed in a pair of double-quotes
  33. >     "'9*9'"         a string enclosed in a pair of double-quotes
  34. >     [ ... ]         the interior of lists
  35. >     { ... }         the interior of vectors
  36. >
  37. > Replacing these four different contexts by a single context, introduced
  38. > by the '"' symbol is, to my way of thinking, a step towards the
  39. > rationalisation of a language that is rapidly evolving away from
  40. > beginners and towards experts, prepared to put up with useful, infrequent
  41. > and obscure idioms.
  42. >
  43. > So instead of writing
  44. >     cons_with erase { this is a quoted collection of words }
  45. > I am suggesting the rather more obvious
  46. >     "this is a quoted collection of words"
  47.  
  48. As I wrote in response to this suggestion posted by Chris Dollin,
  49. there is an objection to this in that the word quote is itself a
  50. lexical word and can be quoted, as in """, and since this is often
  51. part of the process of constructing a list of text items for quoting
  52. things the above proposal would need to be extended to cope with
  53. quoted quotes.
  54.  
  55. Since the percent symbol cannot now occur at top level in Pop-11
  56. except in the partial application syntax  foo(% a, b, c %) it might
  57. be better to use the percent symbol to toggle between quoting and
  58. non-quoting, as already happens inside lists. Then quoting """ would
  59. be easy. Quoting "%" would, as now require some messiness, e.g.
  60.  
  61.     % foo ( %, "%", % a, b, c %, "%", % ) -> x %
  62.  
  63. would be equivalent to
  64.  
  65.     "foo", "(", "%", "a,", "b,", "c", ""%", ")", "->", "x"
  66.  
  67. I.e. quoting all text items in the expression
  68.  
  69.     foo(% a, b, c %) -> x
  70.  
  71. If the proposal for quoting multiple words were not restricted to
  72. quotation within list expressions there's a further problem that you
  73. would lose the current check that occurs if you leave out the second
  74. quote. Pop-11 would go on reading to the end of the file and then
  75. give you an obscure error message. (Just as happens now if you leave
  76. out a closing list bracket, I admit!)
  77.  
  78. > ....POP-11 stands or falls by virtue
  79. > of its reputation.  Improving the quality and reputation of POP-11 benefits
  80. > everyone in the POP community over the long term.  Without this process of
  81. > rationalisation, POP-11 will become an ever-increasingly complex and
  82. > fragmented language.  So it is a cost that experts should be prepared to
  83. > bear -- provided they agree the change is worthwhile!
  84.  
  85. OK I accept that by allowing a new syntax for quoting multiple text
  86. items (e.g. use of %, or maybe ") some of the present convenience of
  87. list expressions with lots of quoted words can be retained.
  88.  
  89. However, I suspect that as regards mis-features this issue of
  90. quotation in list and vectore expressions is minor compared with
  91. others, including letting commas be optional in variable
  92. declarations (which should be phased out as soon as possible) making
  93. input and output locals default to dynamic rather than lexical and
  94. many other permitted alternative forms for the same thing, including
  95. the dreadful toleration of "do" in place of "then" in unless
  96. expressions:
  97.  
  98.     unless foo(x) do x else y endunless -> z
  99.  
  100. Aaron
  101. ---
  102. -- 
  103. Aaron Sloman, School of Computer Science,
  104. The University of Birmingham, B15 2TT, England
  105. EMAIL   A.Sloman@cs.bham.ac.uk  OR A.Sloman@bham.ac.uk
  106. Phone: +44-(0)21-414-3711       Fax:   +44-(0)21-414-4281
  107.