Related articles |
---|
User definable operators wclodius@lanl.gov (William Clodius) (1996-12-14) |
Re: User definable operators fjh@murlibobo.cs.mu.OZ.AU (1996-12-15) |
Re: User definable operators cef@geodesic.com (Charles Fiterman) (1996-12-15) |
Re: User definable operators mslamm@pluto.mscc.huji.ac.il (Ehud Lamm) (1996-12-15) |
Re: User definable operators ddean@CS.Princeton.EDU (1996-12-15) |
Re: User definable operators dennis@netcom.com (1996-12-15) |
Re: User definable operators fjh@mundook.cs.mu.OZ.AU (1996-12-15) |
Re: User definable operators burley@gnu.ai.mit.edu (Craig Burley) (1996-12-18) |
Re: User definable operators jdean@puma.pa.dec.com (1996-12-18) |
Re: User definable operators neitzel@gaertner.de (1996-12-18) |
Re: User definable operators tim@franck.Princeton.EDU (1996-12-20) |
[15 later articles] |
From: | ddean@CS.Princeton.EDU (Drew Dean) |
Newsgroups: | comp.compilers |
Date: | 15 Dec 1996 16:17:55 -0500 |
Organization: | Computer Science Department, Princeton University |
References: | 96-12-088 |
Keywords: | design |
William Clodius <wclodius@lanl.gov> wrote:
>Many programming languages allow the user to overload of language
>defined operators. But a few languages also allow the user to define
>their own operators. ...
Standard ML allows you to define your own operators; basically any
function that takes a pair of arguments (i.e., a 2-tuple) can be made
into an operator. You can specify left- or right-associative (infix
vs. infixr), and a precedence level (0 - 9; 9 is highest). The
reserved word op returns the function associated with the infix
operator.
The people I talk to generally regard this feature as a mistake. It
is not used that often, and I would not be surprised if it goes away.
--
Drew Dean
<ddean@cs.princeton.edu> http://www.cs.princeton.edu/~ddean PSTN: 609-258-1797
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.