caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Prefix operators in ocaml
@ 1999-01-21 14:42 Eduardo Gimenez
  1999-01-21 15:47 ` William Chesters
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eduardo Gimenez @ 1999-01-21 14:42 UTC (permalink / raw)
  To: caml-list; +Cc: Eduardo.Gimenez


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.

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

Of course, I could define a function with the same behavior:
# let cons x y = x::y;;
val cons : 'a -> 'a list -> 'a list = <fun>

but this does not enable to write down expressions like 
match x with cons (a,l) -> l.

PS: I am working in the context of automatic generation of ocaml code,
and being able to have a uniform treatment for datatype constructors
would simplify things a lot....

Thanks in advance,
Eduardo Gimenez.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-01-21 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-21 14:42 Prefix operators in ocaml Eduardo Gimenez
1999-01-21 15:47 ` William Chesters
1999-01-21 16:04 ` Chris Keane
1999-01-21 16:13 ` Jun P. Furuse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).