From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 6A88EBB83 for ; Wed, 13 Sep 2006 20:10:16 +0200 (CEST) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8DIABfd016246 for ; Wed, 13 Sep 2006 20:10:16 +0200 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id DD302DA62DF; Wed, 13 Sep 2006 14:10:03 -0400 (EDT) Received: from heartbeat1.internal ([10.202.2.160]) by frontend3.internal (MEProxy); Wed, 13 Sep 2006 14:10:05 -0400 X-Sasl-enc: Klms5/MKB3Hedh2QbhdvHMBIr5NLSPQh9wHvp9BKr2gG 1158171004 Received: from [172.16.112.115] (burnham.ljcrf.edu [192.231.106.2]) by mail.messagingengine.com (Postfix) with ESMTP id 5DE4FFA95; Wed, 13 Sep 2006 14:10:04 -0400 (EDT) Date: Wed, 13 Sep 2006 11:09:42 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@localhost To: virgile.prevosto@m4x.org Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] caml versions format In-Reply-To: <278733770609130912k5515dcbbt39ad88372da60b53@mail.gmail.com> Message-ID: References: <4508250C.60508@inria.fr> <278733770609130912k5515dcbbt39ad88372da60b53@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-j-chkmail-Score: MSGID : 45084983.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 45084983.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; guillaume:01 guillaume:01 ocaml:01 ocaml:01 libref:01 3.08.3:01 val:01 val:01 1977:98 2006,:98 2006:98 wrote:01 minor:01 minor:01 caml-list:01 On Wed, 13 Sep 2006, Virgile Prevosto wrote: > Hello Guillaume, > > 2006/9/13, Guillaume Rousse : > > I just get struck by a "3.10+dev8" version string, which breaks my > > assumtion that ocaml version are always formated as X.Y.Z, where X, Y > > and Z are numerical only. > > I had the same issue once. Since then, the documentation for > Sys.ocaml_version details what you can find in the string: > http://caml.inria.fr/pub/docs/manual-ocaml/libref/Sys.html > (this is the last item in the page). Basically, you have something like > X.Y[.Z][+comment], where the last two parts are optional. In the micmatch tutorial, I give this example, which should parse the version string correctly (or abort): # Sys.ocaml_version;; - : string = "3.08.3" # RE num = digit+;; # let / (num as major : int) "." (num as minor : int) ("." (num as patchlevel := fun s -> Some (int_of_string s)) | ("" as patchlevel = None)) ("+" (_* as additional_info := fun s -> Some s) | ("" as additional_info = None)) eos / = Sys.ocaml_version ;; val additional_info : string option = None val major : int = 3 val minor : int = 8 val patchlevel : int option = Some 3 -- Martin Jambon, PhD http://martin.jambon.free.fr