home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / function / 1047 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.5 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!uw-beaver!news.u.washington.edu!usenet.coe.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!ulysses!allegra!alice!ark
  2. From: ark@alice.att.com (Andrew Koenig)
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: pairs vs. triples
  5. Message-ID: <23577@alice.att.com>
  6. Date: 28 Aug 92 15:24:46 GMT
  7. References: <1992Aug26.141437.8465@swift.cs.tcd.ie>
  8. Reply-To: ark@alice.UUCP ()
  9. Organization: AT&T Bell Laboratories, Murray Hill NJ
  10. Lines: 24
  11.  
  12. In article <1992Aug26.141437.8465@swift.cs.tcd.ie> butrfeld@swift.cs.tcd.ie writes:
  13.  
  14. > In a language called Sticks&Stones, based loosely on ML, that I have
  15. > used, the following equality always held:
  16.  
  17. > (a,(b,c)) = (a,b,c)
  18.  
  19. > In other words a triple is simply a pair whose second item is a pair.
  20. > Note that ((a,b),c) is not a triple.
  21.  
  22. It sounds like that language didn't allow triples at all, only pairs.
  23. It's certainly possible to do that, but that would certainly be less
  24. convenient in other ways.
  25.  
  26. For example, in ML a pair is a special case of a more general record
  27. type that consists of name-value pairs known and checked at compile
  28. time.  A pair is just a record whose components are named 1 and 2;
  29. a triple is a record with components named 1, 2, and 3, and so on.
  30. I don't see how to allow pairs and not triples with that kind of
  31. unified design, and that unification is truly elegant and makes
  32. all sorts of other things easier to understand.
  33. -- 
  34.                 --Andrew Koenig
  35.                   ark@europa.att.com
  36.