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