caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Étienne André" <Etienne.Andre@univ-paris13.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Build number and date in OCaml?
Date: Tue, 9 Apr 2013 13:38:24 +0200	[thread overview]
Message-ID: <CAB+Vvvgfrez6qedMwyj4_2fjPy+x_DyGzSOBXKQ4paLNEtk3mg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

Hi,

I've been using OCaml for a couple of years, but without using any advanced
feature; so my question may be a little naive.
Is there any way to insert easily the current date and time of compiling,
as well as, e.g., an incremental build number in an OCaml program?
So that it is printed at runtime, e.g., in the program header.

I quite stupidly used the Unix.gettimeofday() function before realizing
that it is of course executed at runtime.

Of course, I could do it using an external script that would modify the
OCaml source code before compiling, but is there any native OCaml feature
for achieving this in a cleaner manner?

Thank you,
--
Étienne André
Université Paris 13, Sorbonne Paris Cité
http://www-lipn.univ-paris13.fr/~andre

[-- Attachment #2: Type: text/html, Size: 876 bytes --]

             reply	other threads:[~2013-04-09 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 11:38 Étienne André [this message]
2013-04-09 12:18 ` Jeremie Dimino
2013-04-10  8:49 ` Julien Signoles
2013-04-10  9:08   ` David Allsopp
2013-04-11 13:00 ` Alain Frisch
2013-04-12 14:38   ` Daniel Weil

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=CAB+Vvvgfrez6qedMwyj4_2fjPy+x_DyGzSOBXKQ4paLNEtk3mg@mail.gmail.com \
    --to=etienne.andre@univ-paris13.fr \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).