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

  1. Path: sparky!uunet!mcsun!uknet!mucs!m1!bevan
  2. From: bevan@cs.man.ac.uk (Stephen J Bevan)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <BEVAN.92Nov13173633@beluga.cs.man.ac.uk>
  6. Date: 13 Nov 92 17:36:33 GMT
  7. References: <721458276@sheol.UUCP> <veit.721491920@du9ds3>
  8.     <KERS.92Nov12085629@cdollin.hpl.hp.com>
  9.     <BxMCxA.3nM@mentor.cc.purdue.edu>
  10. Sender: news@cs.man.ac.uk
  11. Organization: Department of Computer Science, University of Manchester
  12. Lines: 23
  13. In-reply-to: hrubin@pop.stat.purdue.edu's message of 12 Nov 92 20:00:45 GMT
  14.  
  15. In article <BxMCxA.3nM@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  16.    If you could write 
  17.  
  18.    define    (x ++ y) x+y+1
  19.  
  20.    I would accept that as the insertion of the ++ operator.
  21.  
  22. Ah, so now that your given an example of a language in which you can
  23. do the desired operation, you complain about the syntax!  How about
  24. the following :-
  25.  
  26.  infix 0 ++
  27.  
  28.  x ++ y = x+y+1
  29.  
  30.  
  31. Note 1. I've arbitrarily chosen the associativity and precedence as
  32.         you didn't state any preference.
  33.      2. "++" is already defined in Haskell, so you'd need to explicitly
  34.     override the default definition, this would be done at the
  35.     module level.
  36.  
  37. bevan
  38.