home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!keele!nott-cs!ucl-cs!news
- From: S.Courtenage@cs.ucl.ac.uk (SA Courtenage)
- Newsgroups: comp.lang.misc
- Subject: Re: languages which allow the introduction of new operators
- Message-ID: <3221@ucl-cs.uucp>
- Date: 16 Nov 92 18:41:33 GMT
- Sender: news@cs.ucl.ac.uk
- Lines: 26
-
-
- Just out of interest, Gofer (a functional language v.similar to Haskell)
- allows the following to be defined.
-
-
- ------ cut here for Gofer script ------------
- >
-
- >(#) :: Int -> Int -> Int
- >(#) n m = n + m + 1
-
- --------------- end cut ---------------------
-
- Typing
-
- 3 # 4
-
- then gives the result 8.
-
- Haskell is more sophisticated in this respect, through its type classes.
-
- Simon Courtenage Email: scourten@uk.ac.ucl.cs
- Dept of Computer Science
- University College London
- London WC1E
- England
-