home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pop / 151 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  4.0 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Wed, 16 Dec 1992 16:27:24 GMT
  3. Subject: Re: Syntax Misdesign
  4. Message-ID: <KERS.92Dec16162724@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!europa.asd.contel.com!emory!swrinde!cs.utexas.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.lang.pop
  8. References: <116670032@otter.hpl.hp.com> <BzBpvA.9F4@cs.bham.ac.uk>
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 73
  11. In-Reply-To: axs@cs.bham.ac.uk's message of 15 Dec 92 23:13:58 GMT
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14. In article ... axs@cs.bham.ac.uk (Aaron Sloman) writes:
  15.  
  16.    In Pop-11 if you want to evaluate a bit of text to get one element
  17.    you have to do just:
  18.  
  19.        [%f(x)%]
  20.  
  21.    It's much easier where the default is quotation to have a single
  22.    pair of brackets to unquote, than when the default is evaluation and
  23.    lots of quotation marks are needed to quote. Of course, in Lisp you
  24.    don't need lots of quotation marks as a prefix quotes the whole list
  25.    expression.
  26.  
  27. In Pepper I have taken the step Steve describes: the list and vector syntax do
  28. *not* automatically quote. (Why should they?) You want quotation, you quote
  29. things, and a natural extension to Pop word-quotation is to allow *any* number
  30. of items between quotes.
  31.  
  32. Thus the Pop list [bill and ben the flowerpot men] becomes the Pepper list
  33. ["bill and ben the flowerpot men"]. This means that it is not the case that
  34. ``lots'' of quotation marks are needed to quote, at least in examples like
  35. this. 
  36.  
  37. It gets a bit more irritating in expressions like:
  38.  
  39.     [
  40.     ["bill and ben and little weed"],
  41.     ["andy and teddy and looby loo"],
  42.     ["thomas the tank engine and friends"]
  43.     ]
  44.  
  45. but not, I think, significantly more so. As a quick bit of false statistics,
  46. I went through about 13K lines of Pop in my Play directory. Just over 1100
  47. lines had list brackets (excluding lines using []); 380 of those used % and 279
  48. used ^, so well over half of those lists needed unquoted material in them.
  49. (Only 141 lines used vector brackets, with unquotes appearing in over 90 of
  50. those lines.)
  51.  
  52. NOTE WELL these figures are distorted by multi-line expressions and multiple
  53. expressions per line. But they are suggestive.
  54.  
  55. Now you can get irritated (and I did) by the result of separating list and
  56. vector syntax from quotation; sometimes, when you want to build a list that is
  57. a mixture of quoted and unquoted material, it is a nusiance. But this is true
  58. in Pop, too. And I will admit, I did spoil the purity of my position by
  59. extending the quotation syntax to allow lists, vectors, and unquoted material
  60. to appear within it. But the result -- that dropping into quotation mode is
  61. signalled explicitly by quotation marks, which happen to allow list and vector
  62. constructs within them -- is, I think, a rather nicer design.
  63.  
  64.    Probably one of the most serious misdesigns is that there's no good
  65.    syntax for defining procedures that take different combinations of
  66.    arguments, like, for example, newanyarray or newarray. You have to
  67.    write horrible code to test what's on the top of the stack.
  68.  
  69. Well ... I think the horrid code warns us about the horrid idea. I've always
  70. been unhappy about procedures like newarray *because* they take different
  71. numbers of arguments, the number being determined by the types of the ``fixed''
  72. arguments. I think this is one place where the open stack can become a road to
  73. hell. (I'm happy with procedures that take a counted argument, such as
  74. consstring; I'm less happy with consword, even though I implemented the same
  75. interface in Pepper -- partly for efficiency in the lexical analyser! Perhaps
  76. the advent of a suitable typechecker will assuage my fears. But more of that in
  77. another note, probably after Christmas.)
  78.  
  79. PS When I left him, Steve was just coming to the boil.
  80.  
  81.    We need a syntax that uses patterns to handle the different cases.
  82.    (Like prolog?)
  83. --
  84.  
  85. Regards, Kers | "Once   I would have been glad   to have made your acquaintance
  86. Renaissance:  | Now   I feel the danger   brought about   by circumstance."
  87.