Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Prefix operators in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-01-21 (18:26)
From: William Chesters <williamc@d...>
Subject: Prefix operators in ocaml
Eduardo Gimenez writes:
 > Hello,
 > Which is the "prefix" name in Ocaml for the multiplication on
 > integers? The symbols (+), (/), etc. work fine for the other
 > arithmetic operations, but the symbol (*) does not.

LOL :) :).

It's because (* begins a comment *).
You have to write ( * ).

This is truly disgusting and is on a par with C++'s "idiom"

	List<Array<int> >

 > Similarly, is there any prefix name for the list constructor (a::l) ?
 > I am thinking in something like (::) .... 

Yes, this is an example where following SML/NJ's habit of treating
constructors more uniformly with functions would be advantageous.
Although for all I know there may be implementation reasons not to do