<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/12/9b00251c6816fbc02c4a06d09719d33e"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2002-12-03T23:21:13"
  subject="Re: [Caml-list] function"
  prev="2002/12/ae39de99bd31c4b6bd02e32cf55047b4"
  next="2002/12/2460a60612b172a3906a98662afed12a"
  prev-in-thread="2002/12/01b22e6f3b5a5470860e77cba7c48d8e"
  next-in-thread="2002/12/3a29f1975beda5e8c692774800ed0d87"
  prev-thread="2002/12/e69ce402ec37766285461eb0c4583d17"
  next-thread="2002/12/838549db9eab58c179d31f32eefdf381"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] function">
<msg 
  url="2002/12/67f44329195eaf652b43093fd3ca01ba"
  from="altavillasalvatore@libero.it &lt;altavillasalvatore@l...&gt;"
  author="altavillasalvatore@libero.it"
  date="2002-12-02T15:55:08"
  subject="[Caml-list] function">
<msg 
  url="2002/12/aa10f5e9e0a36a35e6d25918c9404768"
  from="sebastien FURIC &lt;sebastien.furic@t...&gt;"
  author="sebastien FURIC"
  date="2002-12-02T16:30:12"
  subject="Re: [Caml-list] function">
</msg>
<msg 
  url="2002/12/01b22e6f3b5a5470860e77cba7c48d8e"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-02T17:35:49"
  subject="Re: [Caml-list] function">
</msg>
<msg 
  url="2002/12/9b00251c6816fbc02c4a06d09719d33e"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2002-12-03T23:21:13"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/3a29f1975beda5e8c692774800ed0d87"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2002-12-05T10:01:05"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/019830184ea14462c3df69900b5a0cda"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2002-12-05T20:24:25"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/6a861191e568645e8947da7ef9a991bc"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T23:01:21"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/5581c0bd84fc85a1433cc7954b60ed48"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2002-12-06T21:30:52"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/458ac04874c1d4210349ca4aef0cefb1"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-12-07T10:28:25"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/938da7b77f8b3b294f4ae5d5dade6d4f"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-07T17:32:03"
  subject="Re: [Caml-list] function">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/12/ae8917859b7799193678c7a51ce64247"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-12-05T20:47:21"
  subject="Re: [Caml-list] function">
<msg 
  url="2002/12/87e12bef39b1bf9fc066aa51f3deb525"
  from="Pal-Kristian Engstad &lt;engstad@n...&gt;"
  author="Pal-Kristian Engstad"
  date="2002-12-05T21:04:47"
  subject="Re: [Caml-list] function">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Mon, Dec 02, 2002 at 04:55:06PM +0100, altavillasalvatore@libero.it wrote:
&gt; Hi all,
&gt; I would want to know if a function exists that allows me to make this:
&gt; 
&gt; ["123";"45";"678"]  -&gt;  [1;2;3;4;5;6;7;8;].

let f l = 
  let ret = ref [] in
  String.iter 
    (fun c -&gt; ret := ((int_of_char c) - (int_of_char '0')) :: !ret) 
    (List.fold_left (^) "" l);
  List.rev !ret;;
  
f ["123";"45";"678"];;

Cheers,
Issac Trotts

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

</contents>

</message>

