From: Martin Jambon <martin1977@laposte.net>
To: virgile.prevosto@m4x.org
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] caml versions format
Date: Wed, 13 Sep 2006 11:09:42 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0609131105001.14202@localhost> (raw)
In-Reply-To: <278733770609130912k5515dcbbt39ad88372da60b53@mail.gmail.com>
On Wed, 13 Sep 2006, Virgile Prevosto wrote:
> Hello Guillaume,
>
> 2006/9/13, Guillaume Rousse <Guillaume.Rousse@inria.fr>:
> > 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
prev parent reply other threads:[~2006-09-13 18:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 15:34 Guillaume Rousse
2006-09-13 16:12 ` [Caml-list] " Virgile Prevosto
2006-09-13 18:09 ` Martin Jambon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0609131105001.14202@localhost \
--to=martin1977@laposte.net \
--cc=caml-list@yquem.inria.fr \
--cc=virgile.prevosto@m4x.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox