Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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;;

  Jean-Francois