List Info

Thread: "ocaml_beginners"::[] what's the "-" mean in output




"ocaml_beginners"::[] what's the "-" mean in output
country flaguser name
United States
2007-05-21 09:51:27

i couldn't find the answer online. thanks!

1. what's the "-" mean?
# let double x =
x*2
in
List.map double [1;2;3;];;
- : int list = [2; 4; 6]

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

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] what's the "-" mean in output
country flaguser name
United Kingdom
2007-05-21 20:37:21

On Monday 21 May 2007 15:51:27 LianYang wrote:
> i couldn't find the answer online. thanks!
>
> 1. what's the "-" mean?
> # let double x =
> x*2
> in
> List.map double [1;2;3;];;
> - : int list = [2; 4; 6]

That means you typed in an expression that evaluated to a value, as opposed to
a definition:

# 3;;
- : int = 3

# let x = 3;;
val x : int = 3

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e

__._,_.___
.

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

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