List Info

Thread: "ocaml_beginners"::[] (*) is not multiplication




"ocaml_beginners"::[] (*) is not multiplication
country flaguser name
United States
2007-02-05 08:58:49



Hello all,

According to the latest (3.09) Objective Caml manual, (*) is
the multiplication function int->int->int, just like (+) or
(/). My toplevel begs to differ :

d212-96-69-170:~ ewan$ ocaml
Objective Caml version 3.09.3

# (+);;
- : int -> int -> int = <fun>;
# (/);;
- : int -> int -> int = <fun>;
# (*);;
Warning C: this is the start of a comment.
*

Is it an error in the manual, or am I using the wrong "*&quot;
character (or encoding ?) on my Mac ?

Ewan

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] (*) is not multiplication
country flaguser name
United States
2007-02-05 09:07:09

Just put a space between the asterisk and the parens:

# ( * );;
- : int -> int -> int = <fun>;

Debo

On 5-Feb-07, at 6:58 AM, roparzhhemon wrote:

>
&gt;
> Hello all,
>;
> According to the latest (3.09) Objective Caml manual, (*) is
> the multiplication function int->int->int, just like (+) or
> (/). My toplevel begs to differ :
>
> d212-96-69-170:~ ewan$ ocaml
&gt; Objective Caml version 3.09.3
&gt;
> # (+);;
&gt; - : int -> int -> int = <fun>;
> # (/);;
&gt; - : int -> int -> int = <fun>;
> # (*);;
&gt; Warning C: this is the start of a comment.
> *
>
> Is it an error in the manual, or am I using the wrong "*&quot;
> character (or encoding ?) on my Mac ?
>
> Ewan
>;
>
>

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] (*) is not multiplication
country flaguser name
United Kingdom
2007-02-05 09:03:31

On Monday 05 February 2007 14:58, roparzhhemon wrote:
&gt; Hello all,
>;
> According to the latest (3.09) Objective Caml manual, (*) is
> the multiplication function int->int->int, just like (+) or
> (/). My toplevel begs to differ :
>
> d212-96-69-170:~ ewan$ ocaml
&gt; Objective Caml version 3.09.3
&gt;
> # (+);;
&gt; - : int -> int -> int = <fun>;
> # (/);;
&gt; - : int -> int -> int = <fun>;
> # (*);;
&gt; Warning C: this is the start of a comment.
> *
>
> Is it an error in the manual, or am I using the
> wrong "*&quot; character (or encoding ?) on my Mac ?

You must put spaces to disambiguate:

( * )

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] (*) is not multiplication
country flaguser name
Germany
2007-02-05 09:09:45


you need to write it with a space:

( * )

cheers,
Michael

> .

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )