<?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/07/bafcc930158b1e4ef9cf8990deef2a44"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T09:56:48"
  subject="Re: [Caml-list] productivity improvement"
  prev="2002/07/95b53058ae34958c36f4248bad4a51d8"
  next="2002/07/5830232e60808a2a2d12b2619015af15"
  prev-in-thread="2002/07/4ea471c9b5dc5d496a40fb34a60d9f00"
  next-in-thread="2002/07/ac004f0bf1e2757debd128f2def8ef91"
  prev-thread="2002/07/c22d9fd21bcea5691f5678e925df1862"
  next-thread="2002/07/1555d185cf3a3a8758041c92a7f7d521"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/315f6c499a501e6f0b02d1bddacd4ee1"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-18T23:13:10"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/4675668fddffa94f558110a6a47fcea6"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2002-07-18T23:54:10"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/4890279c2ad66748afc7cb554cf02ebe"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T03:58:12"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/cdd23bf04bb19a6191ed787cbb39b10b"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T08:21:49"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/0a22394ba16e1be19dbc11a844233536"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2002-07-19T08:50:40"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/5830232e60808a2a2d12b2619015af15"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T10:06:47"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/c0f52395e551fc67daf00d3613dcd063"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-07-19T18:15:49"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/b61fd235edd5b365489366fade93ada5"
  from="Brian Smith &lt;brian-l-smith@u...&gt;"
  author="Brian Smith"
  date="2002-07-19T18:33:21"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/5cecdbd360abfdc5b5553e4a24e44dd3"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-07-20T17:30:44"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
<msg 
  url="2002/07/fcdb1d567d28038f0795dbedc8703612"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T18:59:30"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/1311d5475a156defb5e3448f20d85315"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-07-20T17:49:11"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/2ca0ce69b274daa5d62c6c200453fdc9"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T10:37:27"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/d0f044211e2146d5acbb23e7a5bfbd75"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2002-07-19T17:19:07"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/e526f6886b6068d87015ec9c87602b52"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-07-20T16:58:22"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/aa90e8987502a2062bb4131d5b0d2901"
  from="Brian Rogoff &lt;bpr@a...&gt;"
  author="Brian Rogoff"
  date="2002-07-19T16:35:12"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/9a655e0da7b32273cb71f8cc5fe7c8c6"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-10-17T08:32:49"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
<msg 
  url="2002/07/4e7fd140d3b4edee8e9e2f6acc9fd1eb"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T01:18:46"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/fe3c7bd3d243f1f7b4c2eed75e44d456"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T04:03:10"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/61090af523bf875fc4ebc1a4a14c8ce7"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T15:39:39"
  subject="Re: [Caml-list] Rule based language [was: productivity improvement]">
<msg 
  url="2002/07/ffda4354af9f91affee591b990f23ce1"
  from="Julie Farago &lt;farago@e...&gt;"
  author="Julie Farago"
  date="2002-07-19T17:20:45"
  subject="[Caml-list] compact.c">
</msg>
</msg>
</msg>
<msg 
  url="2002/10/2673b6a958e12595d4f377eb23300fde"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-10-15T11:00:27"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/10506201acc84b3fca638f4cce55748f"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-10-15T12:34:11"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/227d76b8e3291647b70e216a84ed1050"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-10-15T17:11:16"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/4ea471c9b5dc5d496a40fb34a60d9f00"
  from="Emmanuel Renieris &lt;er@c...&gt;"
  author="Emmanuel Renieris"
  date="2002-07-19T04:42:09"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/bafcc930158b1e4ef9cf8990deef2a44"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-19T09:56:48"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/ac004f0bf1e2757debd128f2def8ef91"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T10:36:32"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/d268d6d85acf33a994f988ac968b22bc"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-19T10:52:32"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/07/2c53d122c8500845192452834a5d8d93"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-19T11:29:39"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
<msg 
  url="2002/07/12e8fc3009383004d83e8e746bc02072"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-19T11:11:20"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/162c10804d9252dab346d1f6647961a3"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-10-15T11:00:20"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/32721a368455f27fc6b2ac163ff47e35"
  from="Pal-Kristian Engstad &lt;engstad@n...&gt;"
  author="Pal-Kristian Engstad"
  date="2002-10-15T18:47:16"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/3b927989eeb00f13d1a3a08adb0b5a6d"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-10-17T08:38:01"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/d0b38de16b1d88ea930f2525d7d74e4f"
  from="Diego Olivier Fernandez Pons &lt;Diego-Olivier.FERNANDEZ-PONS@c...&gt;"
  author="Diego Olivier Fernandez Pons"
  date="2002-10-17T09:37:54"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/1e715e1544ec6426c6727ba80f862674"
  from="Jeffrey Palmer &lt;jeffrey.palmer@a...&gt;"
  author="Jeffrey Palmer"
  date="2002-10-17T15:55:10"
  subject="Re: [Caml-list] productivity improvement">
<msg 
  url="2002/10/71058b239015be081d7e541a46413fdb"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2002-10-17T16:15:12"
  subject="Re: [Caml-list] productivity improvement">
</msg>
<msg 
  url="2002/10/69ccda807609447f6e2af2b2ea80fffe"
  from="Christophe TROESTLER &lt;debian00@t...&gt;"
  author="Christophe TROESTLER"
  date="2002-10-17T18:18:35"
  subject="[Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
<msg 
  url="2002/10/b3805138b0c1ce941e882eacd4fc29f4"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2002-10-17T18:32:17"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
<msg 
  url="2002/10/66d9636fac47bb0d8d0c660b7a7c7248"
  from="Shivkumar Chandrasekaran &lt;shiv@e...&gt;"
  author="Shivkumar Chandrasekaran"
  date="2002-10-17T19:07:17"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
<msg 
  url="2002/10/d7aa0ce05030395f08a19034ab71f870"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2002-10-17T20:01:33"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
</msg>
</msg>
<msg 
  url="2002/10/806efec1e799f5e5422d49df924ab818"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-10-17T19:36:46"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
</msg>
<msg 
  url="2002/10/a4392f89c82205d6aa4773c0c0f70926"
  from="Brian Hurt &lt;brian.hurt@q...&gt;"
  author="Brian Hurt"
  date="2002-10-17T19:53:39"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity  improvement)">
<msg 
  url="2002/10/ddd8ec5b5184177f3e93a81c4b28d0a2"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2002-10-17T20:22:37"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity  improvement)">
<msg 
  url="2002/10/59fce5d6bf17d1c6e156ae7dd6ec2538"
  from="Brian Hurt &lt;brian.hurt@q...&gt;"
  author="Brian Hurt"
  date="2002-10-17T21:14:20"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/3eec5b83b44876bb4b82e66661e3b3fc"
  from="Jeffrey Palmer &lt;jeffrey.palmer@a...&gt;"
  author="Jeffrey Palmer"
  date="2002-10-17T21:37:32"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/6491c619e07668fd8cdd02bdbdae9256"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-10-17T23:45:08"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/c0bd2ffc4c8328c165b20226be4c5c76"
  from="Jeffrey Palmer &lt;jeffrey.palmer@a...&gt;"
  author="Jeffrey Palmer"
  date="2002-10-18T00:57:51"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/c266d8e7c314cdea2d0a086091f77b21"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-10-18T04:11:03"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/f1b9af8d9099b116f83eb5d9c6c6db10"
  from="Remi VANICAT &lt;vanicat@l...&gt;"
  author="Remi VANICAT"
  date="2002-10-18T08:23:29"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/a221071f0765da003963569e48fed7e2"
  from="Sven Luther &lt;luther@d...&gt;"
  author="Sven Luther"
  date="2002-10-18T08:46:51"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/10/2585e980ce3edfe7f38579edd7631029"
  from="Brian Hurt &lt;brian.hurt@q...&gt;"
  author="Brian Hurt"
  date="2002-10-18T01:41:36"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
</msg>
</msg>
<msg 
  url="2002/10/2e244c3c0a6a92d79ba5a6d70d723f4b"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2002-10-18T08:29:38"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity   improvement)">
<msg 
  url="2002/10/33dd1413d1a28faa17e2ee72c0a8ef0d"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2002-10-18T23:55:57"
  subject="Re: [Caml-list] Re: Camlp4 optimizations (was: productivity    improvement)">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/10/7ce12a7a2b633b8a4d7b7762f30c116a"
  from="Diego Olivier Fernandez Pons &lt;Diego-Olivier.FERNANDEZ-PONS@c...&gt;"
  author="Diego Olivier Fernandez Pons"
  date="2002-10-18T10:45:30"
  subject="Re: [Caml-list] productivity improvement">
</msg>
<msg 
  url="2002/10/dd0c7f80fedaa74938f2ed0a6aaa952e"
  from="Francois Pottier &lt;francois.pottier@i...&gt;"
  author="Francois Pottier"
  date="2002-10-21T08:57:04"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/cfac32c08aafecbb2414ee0832350833"
  from="Brian Smith &lt;blsmith@b...&gt;"
  author="Brian Smith"
  date="2002-07-20T14:28:01"
  subject="Re: [Caml-list] productivity improvement">
</msg>
</msg>
</thread>

<contents>
On Friday 19 July 2002 12:42 am, Emmanuel Renieris wrote:
&gt; I see two ways to weed through this list:
&gt; Tell us what _you_ find hard/awkward/impossible in C++. Maybe somebody
&gt; will be able to point out how they are easier in Ocaml (if indeed they
&gt; are).

The first thing that comes to mind: a program that would read, write, listen, 
look, speak, comprehend and pass the Turing test seems to be hard to create 
in C++. So hard, I've never tried[1] I'm not sure if it's the language 
though, although it could be.

&gt; Show us some of your ocaml code. Maybe there is some idiom you don't
&gt; have yet, and that would make a difference.

Since this is the second time I'm asked, I will have to do that, even though 
the program is really straight-forward, silly and uninstructive. Description 
first, code at the end: Sometimes, when I feel like being organized and 
productive[2], which happens no more than thrice per fortnight, I plan things 
to do in advance and estimate time it will take me to do them: I edit a file 
containing a list of tasks and time in minutes, e.g.

&lt;stdin&gt;
finish reading chapter 13 of ocaml book 30
Determine Dr. Leroy's involvement in JFK assassination 180
call dad 20
have supper 20
Go through T&amp;R level in Halo in Legendary mode 30000
&lt;/stdin&gt;

The program reads it from STDIN, calculates completion times and formats 
everything into a neat HTML table in STDOUT. I have a bash alias that glues 
VIM, this program and browser together, of course.

Oleg

[1] I'm not kidding. It really is hard.
[2] And I actually am much more productive when I do that

-------------------------------------------------------
let print_aux hours minutes = 
    if hours &lt; 10 then print_char ' ';
    print_int hours;
    print_char ':';
    if minutes &lt; 10 then print_char '0';
    print_int minutes;;

let print_time m =
    let m = m mod (60*24) in
    let hours = m / 60 in
    let hours = hours mod 24 in
    let hours = if hours &gt; 12 then hours - 12 else hours in
    let tag = if m &gt;= 12*60 then "pm" else "am" in
    let minutes = m mod 60 in
    print_aux hours minutes;
    print_string tag;;
    
let print_duration m =
    let hours = m / 60 in
    let hours = hours mod 24 in
    let minutes = m mod 60 in
    print_aux hours minutes;;

let curr_time = 
    let tmp = Unix.localtime (Unix.time ()) in
    tmp.Unix.tm_min + 60 * tmp.Unix.tm_hour;;

let isdigit = function '0' | '1' .. '9' -&gt; true | _ -&gt; false;;

let split_string s = 
    let i = ref (String.length s - 1) in
    while !i &gt;= 0 &amp;&amp; (s.[!i] = ' ' || s.[!i] = '\t') do i := !i-1 done;
    while (!i &gt;= 0) &amp;&amp; (isdigit (s.[!i])) do i := !i-1 done;
    i := !i+1;
    String.sub s 0 !i, int_of_string (String.sub s !i (String.length s - 
!i));;

let print_table_entry name duration curr_time = 
    print_string ("\t&lt;tr&gt;&lt;td align=left&gt;" ^ name ^ "&lt;/td&gt;&lt;td align=right&gt;");
    print_duration duration;
    print_string "&lt;/td&gt;&lt;td align=right&gt;";
    print_time (curr_time + duration);
    print_string "&lt;/td&gt;&lt;/tr&gt;\n";;

print_string "&lt;html&gt;
&lt;title&gt; Schedule &lt;/title&gt;
&lt;body bgcolor=\"#773333\" text=\"#00ff00\"&gt;
&lt;table border=\"2\"&gt;\n";;

let rec read_and_print curr_time =
    let s = input_line stdin in
    let (s, v) = split_string s in
    print_table_entry s v curr_time;
    read_and_print (curr_time + v) 
in try
    read_and_print curr_time
with
    _ -&gt; ();;

print_string "&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;\n";;
-------------------
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>

