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 5461281799 for ; Mon, 22 Jul 2013 16:23:39 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=pra; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=mailfrom; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@einhorn.in-berlin.de) identity=helo; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="postmaster@einhorn.in-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvABABdA7VHAbSoIlGdsb2JhbABahxW3dYUxgQ8WDgEBAQEJCwkJFAQkgiQBAQUjVhALCQUKAgIFIQICDwUYMYgjBKY4kSEWgRKObgeCXTNuA48ZiEOUYg X-IPAS-Result: AvABABdA7VHAbSoIlGdsb2JhbABahxW3dYUxgQ8WDgEBAQEJCwkJFAQkgiQBAQUjVhALCQUKAgIFIQICDwUYMYgjBKY4kSEWgRKObgeCXTNuA48ZiEOUYg X-IronPort-AV: E=Sophos;i="4.89,719,1367964000"; d="scan'208";a="26891506" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jul 2013 16:23:38 +0200 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178017143.adsl.alicedsl.de [85.178.17.143]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id r6MENbeJ028586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 22 Jul 2013 16:23:38 +0200 Received: by first (Postfix, from userid 1000) id 772171548CA6; Mon, 22 Jul 2013 16:23:37 +0200 (CEST) Date: Mon, 22 Jul 2013 16:23:37 +0200 From: oliver To: David Allsopp Cc: "caml-list@inria.fr" Message-ID: <20130722142337.GA2362@siouxsie> References: <20130721225729.5267f17e61a6d904e8e6cc45@gmerlin.de> <20130722114230.GA2070@siouxsie> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] Re: functional or imperative feature ? On Mon, Jul 22, 2013 at 11:46:55AM +0000, David Allsopp wrote: > oliver wrote: > > Maybe it can be called just syntactical sugar... > > Yes... > > > ======================================================================== > > > > let fun_a () = print_endline "A: FooBar"; > > print_endline "A: Baz" > > > > let fun_b () = > > let () = print_endline "B: FooBar" in > > let () = print_endline "B: Baz" in > > () > > ... but not for this translation! Consider > > # 4; 3;; > Characters 0-1: > 4; 3;; > ^ > Warning 10: this expression should have type unit. > - : int = 3 > > By your translation, you'd have: > > # let () = 4 in > 3;; > Characters 9-10: > let () = 4 in > ^ let _ = 4 in _ = 4 in ();; The unit-problem comes from let () = ... ^^ \ unit Ciao, Oliver