Previous week Up Next week


Here is the latest Caml Weekly News, for the week of July 31 to August 21, 2007.

  1. Status of OCaml in Fedora
  2. Handling include files using ocamllex
  3. Str replacement
  4. Announcing OMake - a substantial feature enhancements release
  5. ocaml-curses 1.0.0 released
  6. New mailing list
  7. Unit Testing
  8. If OCaml were a car

Status of OCaml in Fedora


Richard Jones announced:
I thought people might be interested to know how OCaml in Fedora & Red 
Hat Enterprise Linux (RHEL) is getting along. 

We had the packaging guidelines approved about 6 weeks ago which 
allowed packages to start being reviewed 
(  Since then we have 
rebased to OCaml 3.10.0 and packaged up the following: ocamlsdl, 
camlimages, ocurl, expat, extlib, findlib, lablgl, lablgtk2, pcre, 
ocaml-ssl and ulex. 

The following packages are still at various stages in the development 
or review process: calendar, ocamlnet, cduce, coq, PXP, ocaml-csv. 

Interested in joining?  Add your name to our SIG: 

Want to suggest a package for inclusion in Fedora?  Please email me. 

To use the packages, enable the Fedora Development repository 
(/etc/yum.repos.d/development.repo) and just 'yum install ocaml...' 

The complete list of OCaml packages and their versions is shown below. 


Jon Harrop said and Stefano Zacchiroli answered:
> I don't believe the Debian packages for 3.10 have filtered through but I was 

Actually, they are available in experimental. A summary page of what's 
going on in Debian wrt OCaml versions is available at:

What is stopping a full migration to unstable is that some major OCaml 
related packages haven't yet been ported by the respective author to 
OCaml 3.10 and are experiencing CamlP4-related incompatibilities. 

> so desperate to use the awesome new natdynlink branch that upgraded to that 
> from CVS and rebuilt almost all packages from the existing Debian source 
> packages with: 

FWIW, all OCaml related packages in Debian should have a Vcs-Svn field 
pointing to the subversion repository we are using for maintenance (you 
can see it with "apt-get showsrc"). There you can find the current 
working version of the Debian package.

Handling include files using ocamllex


Late in this thread, Erik de Castro Lopo asked and Jacques Garrigue answered:
> Well the problem was that I wanted to do this: 
>     class lexstack top_filename 
>         object 
>             val mutable filename = top_filename 
>             val mutable chan = open_in top_filename 
>             val lexbuf = Lexing.from_channel chan 
> Oops, error message right there ^^^^^^ trying to use instance 
> variable chan. 

Interesting, because the example you describe here is precisely the 
reason it is not allowed (at least as Jerome Vouillon explained to 
That is, you intend the instance variable lexbuf to be the one 
associated to the current (mutable) chan, but if you change chan this 
will no longer be true. 
So, in order to avoid this kind of ambiguity, you have to use let 
defined variables. For instance: 

class lexstack top_filename = 
  let init_chan = open_in top_filename in 
    val mutable filename = top_filename 
    val mutable chan = init_chan 
    val mutable lexbuf_chan = init_chan 
    val mutable lexbuf = Lexing.from_channel init_chan 
    method lexbuf = 
      if chan == lexbuf_chan then lexbuf else 
      (lexbuf <- Lexing.from_channel chan; lexbuf_chan <- chan) 

Note that this restriction applies also to immutable instance 
variables, because you can modify them through functional update 
(the {< chan = ... >} notation.)

Str replacement


John Skaller asked and Xavier Leroy answered:
> When is the Str module going to be extended to provide 
> re-entrant operations?? 

When someone designs a new interface to Str and gets it approved by a 
few respectable members of this community.  A proof-of-concept 
implementation wouldn't hurt either, although I'm OK with writing the 
final implementation.  It's the API for which I don't have ideas. 

> I understand (perhaps incorrectly) that Xavier rewrote the 
> code for this module, and assume the underlying functionality 
> is re-entrant? 


Announcing OMake - a substantial feature enhancements release


Aleksey Nogin announced:
We are proud to announce the latest release of the OMake Build System - 
OMake version 

OMake is a build system designed for scalability and portability. It 
uses a syntax similar to make utilities you may have used, but it 
features many additional enhancements, including the following. 

   - Support for projects spanning several directories or directory 

   - Fast, reliable, automated, scriptable dependency analysis using MD5 
     digests, with full support for incremental builds. 

   - Fully scriptable, includes a library that providing support for 
     standard tasks in C, C++, OCaml, and LaTeX projects, or a mixture 

     Often, a configuration file is as simple as a single line 

     .DEFAULT: $(OCamlProgram prog, foo bar baz) 

     which states that the program "prog" is built from the files,, and This one line will also invoke the default 
     standard library scripts for discovering implicit dependencies in 
     OCaml files. 

   - Full native support for rules that build several files at once. 

   - Portability: omake provides a uniform interface on Linux/Unix 
     (including 64-bit architectures), Win32, Cygwin, Mac OS X, and other 
     platforms that are supported by OCaml. 

   - Built-in functions that provide the most common features of programs 
     like grep, sed, find, and awk. These are especially useful on Win32. 

   - Active filesystem monitoring, where the build automatically restarts 
     whenever you modify a source file. This can be very useful during 
     the edit/compile cycle. 

   - A built-in command-interpreter osh that can be used interactively. 

OMake preserves the style of syntax and rule definitions used in 
Makefiles, making it easy to port your project to OMake. There is no 
need to code in Perl (cons), or Python (scons). However, there are a few 
things to keep in mind: 

  1. Indentation is significant, but tabs are not required. 
  2. The OMake language is functional: functions are first-class and 
     there are no side-effects apart from I/O. 
  3. Scoping is dynamic. 

OMake is licensed under a mixture of the GNU GPL license (OMake engine 
itself) and the MIT-like license (default configuration files). 

Additional information and extensive documentation can be found on OMake 
Home Page at 

OMake is substantial feature enhancements and bugfixes release. 
The changes in this release include: 

    - Fixed Ctrl-C handling on Windows (with now correctly interrupt 
    - Added .STATIC and .MEMO rules, allowing defining lazy computations 
      and lazy memoization maps 
    - Added export sections, making it much easier to manage variable 
    - Fields in sub-objects can now be referenced directly 
    - Many new built-in and library functions 
    - Significant bug-fixes 

For a more verbose change log, please visit . 

Source and binary packages of OMake may be downloaded from . In addition, OMake may be 
obtained via the GODI packaging system. 

To try it out, run the command "omake --install" in a project directory, 
and modify the generated OMakefile. 

OMake is still an alpha release.  While we have made an effort 
to ensure that it is bug-free, it is possible some functions may not 
behave as you would expect.  Please report any comments and/or bugs to 
the mailing list and/or at

ocaml-curses 1.0.0 released


Richard Jones:
I am pleased to announce the first public release of OCaml Curses, 
which is an OCaml binding to the curses/ncurses library. 

This project was formerly called OCaml TMK, and all the actual work on 
it was done by Nicolas George. 

The project homepage is: 

The released version for download is currently here (until I can work 
out how to make releases on the Savannah site ...) 

Mailing list: 

I'd like to add competent and interested developers to the Savannah 
project, particularly the Debian folks who were interested in 
packaging this.  Please mail me privately.

New mailing list


Maxence Guesdon:
A new mailing list,, has been created, to post 
announces regarding jobs and internships for OCaml developers. Feel free to 
register at the following address: 
Do not hesitate to forward this message to interested people who do not 
read the caml-list.
Yaron Minsky asked and Maxence Guesdon answered:
> Does this imply that job announcements are no longer welcome on the ocaml 
> list proper?  I'm worried that the new list will not be subscribed to 
> quite as widely as the caml list... 

Job announcements are still welcome on the caml-list. The new list is for 
people not following high-level discussions on the caml-list but are 
interested in job announcements; it is a way to contact people "explicitly" 
interested in job announcements, whether they are employers or "ocaml 
developers for rent".

Unit Testing


Robert Fischer and Edgar Friendly answered:
> Is there an actively supported unit testing library/framework for Ocaml? 

I believe the Iinteractive people actively use TestSimple internally, 
but they haven't updated the project website to show 0.02, which I have 
a copy of, and there may exist more recent versions as well. 


Maybe this message will provoke an update.
Jeff Meister also answered:
There's OUnit, but I don't know if it's actively maintained. You'd 
have to ask Mr. Zeeman.

If OCaml were a car


Richard Jones said, spawning a big thread:
This is on the first page of Digg at the moment ...

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'&lt;1':1

If you know of a better way, please let me know.

Old cwn

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.

Alan Schmitt