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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 494B37EE34 for ; Fri, 18 Mar 2016 19:06:45 +0100 (CET) IronPort-PHdr: 9a23:L5QHpBOshWFKGajo7mgl6mtUPXoX/o7sNwtQ0KIMzox0KPv5rarrMEGX3/hxlliBBdydsKIUzbKL+Pq5ASQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTnkbjvsMeKO01hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCCG439UdmQNjlIcCAHA6FT+X4ztmir8rOt0nieAa57YV7cxDH6H9eEjaBLykm1PYzs4633akMx9lrhzrgisqhpy38jYbdfGZ7JFYqrBcIZCFiJ6VcFLWnkEW9vkYg== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=misterherr@freenet.de; spf=None smtp.mailfrom=misterherr@freenet.de; spf=None smtp.helo=postmaster@mout0.freenet.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=pra; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=mailfrom; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout0.freenet.de) identity=helo; client-ip=195.4.92.90; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="postmaster@mout0.freenet.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AcAwBdQ+xWk1pcBMMZAkODGaluBAONKYR8gW+HPzkTAQEBAQEBAQEQAQEBAQcNCQkhL4Itgj5VIAEcFgsCCwMCAQIBSw0IAQGIDQEWAwGPBZI7j12KIQmBKwGEIpFmCy0TgkMFl1cBlzIEhVSPBiIBgXVegVKLTAEBAQ X-IPAS-Result: A0AcAwBdQ+xWk1pcBMMZAkODGaluBAONKYR8gW+HPzkTAQEBAQEBAQEQAQEBAQcNCQkhL4Itgj5VIAEcFgsCCwMCAQIBSw0IAQGIDQEWAwGPBZI7j12KIQmBKwGEIpFmCy0TgkMFl1cBlzIEhVSPBiIBgXVegVKLTAEBAQ X-IronPort-AV: E=Sophos;i="5.24,356,1454972400"; d="scan'208,217";a="169455278" Received: from mout0.freenet.de ([195.4.92.90]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2016 19:06:27 +0100 Received: from [195.4.92.140] (helo=mjail0.freenet.de) by mout0.freenet.de with esmtpa (ID misterherr@freenet.de) (port 25) (Exim 4.85 #1) id 1agyn3-0004NX-QM for caml-list@inria.fr; Fri, 18 Mar 2016 19:06:25 +0100 Received: from localhost ([::1]:55871 helo=mjail0.freenet.de) by mjail0.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.85 #1) id 1agyn3-00046v-Ji for caml-list@inria.fr; Fri, 18 Mar 2016 19:06:25 +0100 Received: from mx3.freenet.de ([195.4.92.13]:58546) by mjail0.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.85 #1) id 1agyks-0007lS-0P for caml-list@inria.fr; Fri, 18 Mar 2016 19:04:10 +0100 Received: from x50aba36c.dyn.telefonica.de ([80.171.163.108]:44684 helo=suse132-intel.home.loc) by mx3.freenet.de with esmtpsa (ID misterherr@freenet.de) (TLSv1.2:DHE-RSA-AES128-SHA:128) (port 465) (Exim 4.85 #1) id 1agykr-0007R8-QJ for caml-list@inria.fr; Fri, 18 Mar 2016 19:04:09 +0100 To: Caml List From: "Mr. Herr" X-Enigmail-Draft-Status: N1110 Message-ID: <56EC4318.2020701@freenet.de> Date: Fri, 18 Mar 2016 19:04:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------010908010705070308000508" X-Originated-At: 80.171.163.108!44684 Subject: [Caml-list] what does let () = ... define? This is a multi-part message in MIME format. --------------010908010705070308000508 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, in a small presentation of OCaml (Linux User Group Bremen) I got some interesting questions, and trying to answer I noticed I took something for granted that was not fully understood. Looking at this in the toplevel: # let () = () ;; # () ;; - : unit = () # let _ = () ;; - : unit = () # let None = None;; Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: Some _ # ... the question is: okay, pattern matching left of the equal sign, but what does it define? It defines unit and None in the environment, and then that value is just sitting there? /Str. --------------010908010705070308000508 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi,

in a small presentation of OCaml (Linux User Group Bremen) I got some interesting questions, and
trying to answer I noticed I took something for granted that was not fully understood.

Looking at this in the toplevel:

# let () = () ;;
# () ;;
- : unit = ()
# let _ = () ;;
- : unit = ()
# let None = None;;
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
Some _
#

... the question is: okay, pattern matching left of the equal sign, but what does it define?
It defines unit and None in the environment, and then that value is just sitting there?

/Str.
--------------010908010705070308000508--