home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3635 < prev    next >
Encoding:
Text File  |  1992-11-14  |  2.0 KB  |  39 lines

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