From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2986981799 for ; Mon, 22 Jul 2013 13:20:19 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jean-marc.alliot@irit.fr) identity=pra; client-ip=147.127.176.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jean-marc.alliot@irit.fr"; x-sender="jean-marc.alliot@irit.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jean-marc.alliot@irit.fr) identity=mailfrom; client-ip=147.127.176.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jean-marc.alliot@irit.fr"; x-sender="jean-marc.alliot@irit.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@n7smtp.enseeiht.fr designates 147.127.176.11 as permitted sender) identity=helo; client-ip=147.127.176.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jean-marc.alliot@irit.fr"; x-sender="postmaster@n7smtp.enseeiht.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoBAH4U7VGTf7ALnGdsb2JhbABagzzAf4EOFg4BAQEBAQYWCTyCJQEFMgEFNQsRCyEWDwkDAgECAUUTBgIBAYd6Aw8EtnmNKoJzFoNoA5V4gWWGI4YEiDo X-IPAS-Result: ApoBAH4U7VGTf7ALnGdsb2JhbABagzzAf4EOFg4BAQEBAQYWCTyCJQEFMgEFNQsRCyEWDwkDAgECAUUTBgIBAYd6Aw8EtnmNKoJzFoNoA5V4gWWGI4YEiDo X-IronPort-AV: E=Sophos;i="4.89,718,1367964000"; d="scan'208";a="26863878" Received: from n7smtp.enseeiht.fr ([147.127.176.11]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jul 2013 13:20:18 +0200 Received: from imap.enseeiht.fr (imap.enseeiht.fr [147.127.176.21]) by n7smtp.enseeiht.fr (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r6MBKGKd021501 for ; Mon, 22 Jul 2013 13:20:18 +0200 Received: from [10.31.1.2] (AToulouse-159-1-64-114.w92-134.abo.wanadoo.fr [92.134.215.114]) (authenticated bits=0) by imap.enseeiht.fr (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r6MBKDS0025127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 22 Jul 2013 13:20:16 +0200 Message-ID: <51ED1568.3060609@irit.fr> Date: Mon, 22 Jul 2013 13:20:08 +0200 From: Jean-Marc Alliot User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (n7smtp.enseeiht.fr [147.127.176.11]); Mon, 22 Jul 2013 13:20:18 +0200 (CEST) X-Scanned-By: MIMEDefang 2.64 on 147.127.176.11 Subject: Re: [Caml-list] functional or imperative feature ? Le 21/07/2013 22:50, habet_ms@yahoo.fr a écrit : > Hi, > are sequencing (;) and block structure (begin ... end) functional features > or imperative ones ? > > Thanks, > > M.S > Interesting question, which I sometimes get from my students. I am not giving really an answer (I saw one from David Allsopp), but instead an advice; Ocaml is not the best language to learn "pure" functional programming. If you really want to give it a try, then try Haskell, and if you really want to be "extra-pure", don't use at all Haskell syntactic sugar. You will find all the answers by yourself, maybe the hard way :-) PS: That's not a Haskell vs Ocaml troll. I love both languages, and I am using ocaml much more than Haskell for everyday programming (I consider Ocaml easier to use and even easier to read, but that's strictly IMHO, and maybe just because I am more familiar with it). It's just that, for learning pure functional programming, with lazy evaluation, Haskell is really good.