home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10755 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  2.3 KB

  1. Xref: sparky comp.arch:10755 comp.lang.misc:3695
  2. Newsgroups: comp.arch,comp.lang.misc
  3. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!convex!news.utdallas.edu!corpgate!bnrgate!bnr.co.uk!pipex!ibmpcug!exnet!dhd
  4. From: dhd@exnet.co.uk (Damon)
  5. Subject: Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)
  6. Message-ID: <Bxs63J.BxA@exnet.co.uk>
  7. Organization: ExNet Systems Ltd Public Access News, London, UK
  8. References: <BxoEGs.Ky8@rice.edu> <1992Nov14.022705.15675@sal.wisc.edu> <BxpprG.HKu@mentor.cc.purdue.edu>
  9. Date: Sun, 15 Nov 1992 23:18:54 GMT
  10. Lines: 38
  11.  
  12. In article <BxpprG.HKu@mentor.cc.purdue.edu> hrubin@mentor.cc.purdue.edu (Herman Rubin) writes:
  13. >And how would you handle cases where operations have multiple results,
  14. >of different types?  This should have been in all programming languages
  15. >on day 2, and is now only clumsily handled in some.  How would you 
  16. >handle simple operators which those who produced the languages either
  17. >did not understand, did not think important, or just plain ignored?    
  18.  
  19. In Pascal, or some similar language where everything is built into the
  20. language, like the exact read and write syntax and semantics, you would
  21. have to add all these special cases for special machines and bloat the
  22. language.  Therefore, to avoid inventing PL/1 all over again, they
  23. shouldn't be put in at all.  (To avoid penalising evry implementation,
  24. just like CISC.)
  25.  
  26. Or you put these features in the library.  (Just like RISC.)
  27.  
  28. Which is what C does.
  29.  
  30. I think even C is starting to bloat, but it is still quite honest in
  31. relegating special features---that won't be used/available on *nearly
  32. every* machine or in *a lot* of code---to the libraries.
  33.  
  34. So, returning multiple answers in C is easy if ugly.  Use pointer
  35. arguments, or return a structure or point to one.  It needn't be
  36. expensive at run time.
  37.  
  38. Of course, ML's pattern matching is nice...
  39.  
  40. let val (x:int, y:string) = (mystery_function(args)):t1 ... t3 -> (int*string)
  41.  
  42. ...which is maybe what you are after.
  43.  
  44. Damon
  45. -- 
  46. Damon Hart-Davis                          Internet: dhd@exnet.co.uk, d@hd.org
  47.  
  48. Public-access UNIX (Suns), news and mail for UK#5 per month.  FIRST MONTH FREE.
  49. [1.35] Cheap Sun eqpt.  UUCP news/mail feeds.  Tel/Fax: +44 81 755 0077.
  50.