caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jun P. Furuse" <Jun.Furuse@inria.fr>
To: caml-list@inria.fr
Cc: Eduardo Gimenez <Eduardo.Gimenez@inria.fr>
Date: Thu, 21 Jan 1999 17:13:52 +0100	[thread overview]
Message-ID: <199901211613.RAA16052@pernand.inria.fr> (raw)
In-Reply-To: Your message of Thu, 21 Jan 1999 15:42:20 +0100. <199901211442.PAA19110@pauillac.inria.fr>

> 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.

You need a small trick. Try ( * ) or ( *).
 
> Similarly, is there any prefix name for the list constructor (a::l) ?
> I am thinking in something like (::) .... 

:: is not an infix operator, but an infix constructor. It is handled
specially by the parser. Like the other normal constructors, you
always need its arguments i.e.:

# type 'a option =
    None
  | Some of 'a

# Some;;
The constructor Some expects 1 argument(s),
but is here applied to 0 argument(s)

# fun x -> Some x;;
- : 'a -> 'a option = <fun>

The constructor names themselves are not functions in O'Caml.
 
-----------------------------------------------------------------------
Jun P. Furuse 					 Jun.Furuse@inria.fr
  INRIA
    Institut National de Recherche en Informatique et en Automatique




      parent reply	other threads:[~1999-01-21 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=199901211613.RAA16052@pernand.inria.fr \
    --to=jun.furuse@inria.fr \
    --cc=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;
as well as URLs for NNTP newsgroup(s).