Re: Undefined labels

From: Jean-Francois Monin (JeanFrancois.Monin@cnet.francetelecom.fr)
Date: Fri Nov 12 1999 - 18:11:04 MET


Date: Fri, 12 Nov 1999 18:11:04 +0100
Message-Id: <199911121711.SAA18326@lsun565.lannion.cnet.fr>
From: Jean-Francois Monin <JeanFrancois.Monin@cnet.francetelecom.fr>
To: Christian RINDERKNECHT <rinderkn@hugo.int-evry.fr>
Subject: Re: Undefined labels
In-Reply-To: <19991112134711.B645@jones.int-evry.fr>
        <382AAB06.F3DF8CC0@maxtal.com.au>

> (Unix.fstat argument).Unix.st_kind
> ^^^^
> > Using 'open Unix' is unacceptable.
>
> I also never use the "open" feature, but the consequence is, when using
> nested records, I must qualify all the labels (as in your example),
> and the code becomes unreadable.

Not so unreadable if you declare

module U=Unix

This can be local to a (group of) function(s), e.g.

let f,g =
   let module U = Unix in
   let f argument = (U.fstat argument).U.st_kind in
   let g = 5
   in f,g;;

  Jean-Francois



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET