From: Eduardo Gimenez <Eduardo.Gimenez@inria.fr>
To: caml-list@inria.fr
Cc: Eduardo.Gimenez@inria.fr
Subject: Prefix operators in ocaml
Date: Thu, 21 Jan 1999 15:42:20 +0100 (MET) [thread overview]
Message-ID: <199901211442.PAA19110@pauillac.inria.fr> (raw)
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.
next reply other threads:[~1999-01-21 15:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-21 14:42 Eduardo Gimenez [this message]
1999-01-21 15:47 ` William Chesters
1999-01-21 16:04 ` Chris Keane
1999-01-21 16:13 ` Jun P. Furuse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199901211442.PAA19110@pauillac.inria.fr \
--to=eduardo.gimenez@inria.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox