home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3613 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  2.3 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Thu, 12 Nov 1992 08:56:29 GMT
  3. Subject: Re: languages which allow the introduction of new operators
  4. Message-ID: <KERS.92Nov12085629@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!walter!att-out!pacbell.com!sgiblab!sdd.hp.com!hpscit.sc.hp.com!scd.hp.com!hpscdm!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.lang.misc
  8. References: <BxI802.7EL@mentor.cc.purdue.edu> <721458276@sheol.UUCP> <veit.721491920@du9ds3>
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 40
  11. In-Reply-To: veit@du9ds3.uni-duisburg.de's message of 11 Nov 92 14:25:20 GMT
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14. In article ... veit@du9ds3.uni-duisburg.de (Holger Veit) writes:
  15.  
  16.    In <721458276@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
  17.  
  18.    >: From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  19.    >: Message-ID: <BxI802.7EL@mentor.cc.purdue.edu>
  20.    >: Which languages allow the introduction of new operators?  
  21.  
  22.    >Lisp.  Forth.  Postscript.  Smalltalk.  Full PL/I had the ability
  23.    >to coin new statement types and keywords (though not new
  24.    >expression syntax).
  25.  
  26.    You forgot Prolog.
  27.  
  28. He forgot (if he ever heard of) Pop11, too.
  29.  
  30. But Herman might not think of those things as ``operators''. Consider the Pop11
  31. definition:
  32.  
  33.     define 5 ++( x, y ); lvars x, y; x + y + 1 enddefine;
  34.  
  35. The ``5'' is the precedence (it happens to be the same as ``+'') and makes
  36. ``++'' a (nominally infix) operator, so expressions such as
  37.  
  38.     x ++ y, f(x) ++ g(h(y), z)
  39.  
  40. work. But (in Pop) an operator is *just* a procedure with a pleasant calling
  41. syntax; writing ``x ++ y'' just means ``push x, push y, call ++'' (Pop is an
  42. open-stack language), ``x * y'' means ``push x, push y, call -'', and ``f(x)''
  43. means ``push x, call f''. *Some* procedure calls are coded in-line, but this is
  44. not a property of being (syntactically) operators; it is a property of being a
  45. particular procedure, such as fast_front, or fi_+.
  46.  
  47. I *think*, from earlier discussions, that Herman thinks being-an-operator is
  48. something to do with translating-to-an-instruction (with the appropriate
  49. effect). In which case, as usual, He and Us are talking past each other.
  50. --
  51.  
  52. Regards,    | "See the darkness all around   is coming down on you."
  53. Kers.       | - Renaissnace, ``Running Hard''.
  54.