🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2400

Re: languages which allow the introduction of new operators

#2400
From: Chris Dollin
Date: Fri, 13 Nov 1992 10:04
45 lines
2675 bytes
In article ... hrubin@pop.stat.purdue.edu (Herman Rubin) writes:

[Remarking on my Pop example with ``define 5 ++ (x, y) ...''

   If you could write 

   define	(x ++ y) x+y+1

   I would accept that as the insertion of the ++ operator.  

Well, it seems that this is just a quibble over an (admittedly unpleasant)
definition syntax; I've just checked and conformed that

    define 5 x ++ y; lvars x, y; x + y + 1 enddefine;

is an acceptable form (the ``lvars'' are required for historical reasons; the
Pop9X standard may well make them the default for formal parameters). There are
good Popish reasons for needing the precedence annotation.

   I would definitely
   allow far more complicated versions, as defining the power operator 
   differently depending on the types of the arguments.  

Steve Kinght's ``objectclass'' will allow this, although I don't recall whether
it allows operator definitions too. [Discussion on Pop can now take place on
comp.lang.pop, yipee!]

   But I would object to any language
   which insists that we use a strictly stack machine.  Pushing, popping, and
   calling are to be avoided unless necessary.  Otherwise things just run too
   slowly to be of more than theoretical use.

Pop doesn't insist on a stack *machine*, but it's *model* is stack-based. A Pop
compiler is entitled to elide pushes, pops, and calls where the difference
cannot be seen. But Pop the language is, ineluctably, stack-based, and I wasn't
suggesting that Herman code in Pop; I was pointing out that what the rest of
the programming community see as ``user-defined operators'', and what Herman
means by ``u. d. o's'', are *different things*, and suggesting we agree on some
language. 


--

Regards,    | "Layered protocols give the software implementor a chance to
Kers.       | ruin his performance in each layer." - Don Gillies
Technical Details
Message-ID: <KERS.92Nov13100411@cdollin.hpl.hp.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!olivea!charnel!rat!usc!sdd.hp.com!hpscit.sc.hp.com!scd.hp.com!hpscdm!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
References: <721458276@sheol.UUCP> <veit.721491920@du9ds3> <KERS.92Nov12085629@cdollin.hpl.hp.com> <BxMCxA.3nM@mentor.cc.purdue.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!olivea!charnel!rat!usc!sdd.hp.com!hpscit.sc.hp.com!scd.hp.com!hpscdm!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
From: kers@hplb.hpl.hp.com (Chris Dollin)
Newsgroups: comp.lang.misc
Subject: Re: languages which allow the introduction of new operators
Message-ID: <KERS.92Nov13100411@cdollin.hpl.hp.com>
Date: 13 Nov 92 10:04:11 GMT
References: <721458276@sheol.UUCP> <veit.721491920@du9ds3> <KERS.92Nov12085629@cdollin.hpl.hp.com> <BxMCxA.3nM@mentor.cc.purdue.edu>
Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Lines: 45
In-Reply-To: hrubin@pop.stat.purdue.edu's message of Thu, 12 Nov 1992 20:00:45 GMT
Nntp-Posting-Host: cdollin.hpl.hp.com