Article View: comp.lang.misc
Article #2377Re: languages which allow the introduction of new operators
From: Chris Dollin
Date: Thu, 12 Nov 1992 08:56
Date: Thu, 12 Nov 1992 08:56
40 lines
2400 bytes
2400 bytes
In article ... veit@du9ds3.uni-duisburg.de (Holger Veit) writes:
In <721458276@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
>: From: hrubin@pop.stat.purdue.edu (Herman Rubin)
>: Message-ID: <BxI802.7EL@mentor.cc.purdue.edu>
>: Which languages allow the introduction of new operators?
>Lisp. Forth. Postscript. Smalltalk. Full PL/I had the ability
>to coin new statement types and keywords (though not new
>expression syntax).
You forgot Prolog.
He forgot (if he ever heard of) Pop11, too.
But Herman might not think of those things as ``operators''. Consider the Pop11
definition:
define 5 ++( x, y ); lvars x, y; x + y + 1 enddefine;
The ``5'' is the precedence (it happens to be the same as ``+'') and makes
``++'' a (nominally infix) operator, so expressions such as
x ++ y, f(x) ++ g(h(y), z)
work. But (in Pop) an operator is *just* a procedure with a pleasant calling
syntax; writing ``x ++ y'' just means ``push x, push y, call ++'' (Pop is an
open-stack language), ``x * y'' means ``push x, push y, call -'', and ``f(x)''
means ``push x, call f''. *Some* procedure calls are coded in-line, but this is
not a property of being (syntactically) operators; it is a property of being a
particular procedure, such as fast_front, or fi_+.
I *think*, from earlier discussions, that Herman thinks being-an-operator is
something to do with translating-to-an-instruction (with the appropriate
effect). In which case, as usual, He and Us are talking past each other.
--
Regards, | "See the darkness all around is coming down on you."
Kers. | - Renaissnace, ``Running Hard''.
Technical Details
Message-ID:
<KERS.92Nov12085629@cdollin.hpl.hp.com>Path:
arc1-ca.pugleaf.net!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!kersReferences:
<BxI802.7EL@mentor.cc.purdue.edu> <721458276@sheol.UUCP> <veit.721491920@du9ds3>Show Full Headers
Complete Article Headers
From: kers@hplb.hpl.hp.com (Chris Dollin) Date: Thu, 12 Nov 1992 08:56:29 GMT Subject: Re: languages which allow the introduction of new operators Message-ID: <KERS.92Nov12085629@cdollin.hpl.hp.com> Organization: Hewlett-Packard Laboratories, Bristol, UK. Path: arc1-ca.pugleaf.net!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 Newsgroups: comp.lang.misc References: <BxI802.7EL@mentor.cc.purdue.edu> <721458276@sheol.UUCP> <veit.721491920@du9ds3> Sender: news@hplb.hpl.hp.com (Usenet News Administrator) Lines: 40 In-Reply-To: veit@du9ds3.uni-duisburg.de's message of 11 Nov 92 14:25:20 GMT Nntp-Posting-Host: cdollin.hpl.hp.com