home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / misc / 3719 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  788 b 

  1. Path: sparky!uunet!mcsun!uknet!keele!nott-cs!ucl-cs!news
  2. From: S.Courtenage@cs.ucl.ac.uk (SA Courtenage)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <3221@ucl-cs.uucp>
  6. Date: 16 Nov 92 18:41:33 GMT
  7. Sender: news@cs.ucl.ac.uk
  8. Lines: 26
  9.  
  10.  
  11. Just out of interest, Gofer (a functional language v.similar to Haskell)
  12. allows the following to be defined.
  13.  
  14.  
  15. ------ cut here for Gofer script ------------
  16. >
  17.  
  18. >(#) :: Int -> Int -> Int
  19. >(#) n m = n + m + 1
  20.  
  21. --------------- end cut ---------------------
  22.  
  23. Typing
  24.  
  25.     3 # 4
  26.  
  27. then gives the result 8.
  28.  
  29. Haskell is more sophisticated in this respect, through its type classes.
  30.  
  31. Simon Courtenage        Email: scourten@uk.ac.ucl.cs
  32. Dept of Computer Science
  33. University College London
  34. London WC1E
  35. England
  36.