🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3842

Re: languages which allow the introduction of new operators

#3842
From: SA Courtenage
Date: Mon, 16 Nov 1992 18:41
26 lines
823 bytes
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
Technical Details
Message-ID: <3221@ucl-cs.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!keele!nott-cs!ucl-cs!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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