English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Announcement: automatically resizing arrays
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-11-15 (07:26)
From: Jean-Francois Monin <JeanFrancois.Monin@c...>
Subject: Re: Undefined labels
>         (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;;