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 E691C7ED25 for ; Sun, 21 Jul 2013 22:58:05 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=81.103.221.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Neutral (mail2-smtp-roc.national.inria.fr: domain of dra-news@metastack.com does not assert whether or not 81.103.221.48 is permitted sender) identity=mailfrom; client-ip=81.103.221.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mtaout02-winn.ispmail.ntl.com) identity=helo; client-ip=81.103.221.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@mtaout02-winn.ispmail.ntl.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgwBAHhK7FFRZ90wlGdsb2JhbABagmWBJsAwgRYWDgEBAQEHDQkJFAMlgiQBAQEEJxNPAgEIGAoUEDIlAgQBEgiHdgMQA7YmjSqCOziDEG4DlXiBZYwniDiCKg X-IPAS-Result: AgwBAHhK7FFRZ90wlGdsb2JhbABagmWBJsAwgRYWDgEBAQEHDQkJFAMlgiQBAQEEJxNPAgEIGAoUEDIlAgQBEgiHdgMQA7YmjSqCOziDEG4DlXiBZYwniDiCKg X-IronPort-AV: E=Sophos;i="4.89,714,1367964000"; d="scan'208";a="26795319" Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Jul 2013 22:58:05 +0200 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20130721205804.DHQC23282.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Sun, 21 Jul 2013 21:58:04 +0100 Received: from romulus.metastack.com ([81.98.252.242]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20130721205804.KJLF21648.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Sun, 21 Jul 2013 21:58:04 +0100 Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id r6LKw1CU026913 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 21 Jul 2013 21:58:01 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0123.003; Sun, 21 Jul 2013 21:58:01 +0100 From: David Allsopp To: "habet_ms@yahoo.fr" , "caml-list@inria.fr" Thread-Topic: [Caml-list] functional or imperative feature ? Thread-Index: AQHOhlP4QU2cvZzYpUS8NS6+0zpdT5lvnErQ Date: Sun, 21 Jul 2013 20:58:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.18] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Cloudmark-Analysis: v=1.1 cv=AUhbpHVS+xhHrj9wLCYAQoYnFLYUZdbP8UM0GmH2jwk= c=1 sm=0 a=IXlcok0kcmcA:10 a=S_x1BDfoDsUA:10 a=cTs9vV391PwA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=payxKTrtk4y9gbqBeLAA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Subject: RE: [Caml-list] functional or imperative feature ? habet_ms@yahoo.fr wrote: > Hi, > are sequencing (;) and block structure (begin ... end) functional > features > or imperative ones ? Any sequence e1; e2; e3;; can be rewritten let _ =3D e1 in let _ =3D e2 in e3;; (with the difference that in a sequence, the compiler warns you if e1 and e= 2 don't have type unit)=20 It's not strictly speaking an imperative construct but it's only really of = use in imperative programming. Conversely begin ... end is neither explicitly functional nor imperative - = it's simply a form of brackets. Consider nested matches (definitely functio= nal): let f x y =3D=20 match x with `Foo -> begin match y with `Bar -> true | _ -> failwith "Bar" end | _ -> failwith "Foo" HTH, David=20