Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] small_exercise
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe Raffalli <raffalli@u...>
Subject: Re: [Caml-list] small exercise
altavillasalvatore@libero.it wrote:
> Hi all,
> 
> I do not succeed to develop the following exercise:
> I have need of your aid.
> 
> 
> 
> input:  string    "1.15.120.13.43.35.340.190.0"
> 
> output: int array=  [| 1; 15; 120; 13; 43; 35; 340; 190; 0; |] 
> 
>   : string -> int array
> 
> 
> Regards.

I hope you are not a student trying to have his home work done by this 
mailing list ?

Just a hint look at the documentation of the following functions:

module        | function
------------------------------
str           | split
list          | map
pervasives    | int_of_string
array         | of_list

The answer fits on one (long) line.


-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners