Article View: comp.lang.misc
Article #2397Re: languages which allow the introduction of new operators
From: Herman Rubin
Date: Fri, 13 Nov 1992 15:22
Date: Fri, 13 Nov 1992 15:22
27 lines
2122 bytes
2122 bytes
In article <1992Nov13.073809.11835@arb-phys.uni-dortmund.de> wb@arb-phys.uni-dortmund.de (Wilhelm B. Kloke) writes:
>In article <BxLxqu.96C@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
>>Some of these allow some flexibility in expression syntax. But how
>>many of these could conveniently unpack a floating point number into
>>its exponent and mantissa? In particular, could you write
>> exponent, mantissa =.U float
>If this is the point, there is some clarification needed. You want to
>have a result which is really *2* values. Most languages don't allow
>this. You need a (possibly implicitly constructed) structure to make
>this sort of assignment possible. Defining an unary operator which
>returns a struct is possible at least in C++ and Algol68.
I believe it is possible in Algol68, but it is not possible in C++.
C++ does not allow the introduction of new operator symbols; only new
functions. The above operation is hardware on some machines. And also,
a list is NOT a struct. The idea that a function or operation may
return many values, and that the languages should allow this explicitly,
SHOULD have gotten into programming languages on day 2. Many machines
in the early days of programming languages explicitly did return more
than one result.
--
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
Phone: (317)494-6054
hrubin@snap.stat.purdue.edu (Internet, bitnet)
{purdue,pur-ee}!snap.stat!hrubin(UUCP)
Technical Details
Message-ID:
<Bxnupn.E27@mentor.cc.purdue.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubinReferences:
<1992Nov12.082643.8415@arb-phys.uni-dortmund.de> <BxLxqu.96C@mentor.cc.purdue.edu> <1992Nov13.073809.11835@arb-phys.uni-dortmund.de>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin From: hrubin@pop.stat.purdue.edu (Herman Rubin) Subject: Re: languages which allow the introduction of new operators Message-ID: <Bxnupn.E27@mentor.cc.purdue.edu> Sender: news@mentor.cc.purdue.edu (USENET News) Organization: Purdue University Statistics Department References: <1992Nov12.082643.8415@arb-phys.uni-dortmund.de> <BxLxqu.96C@mentor.cc.purdue.edu> <1992Nov13.073809.11835@arb-phys.uni-dortmund.de> Date: Fri, 13 Nov 1992 15:22:34 GMT Lines: 27