From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA28135 for caml-redistribution@pauillac.inria.fr; Mon, 15 Nov 1999 08:27:55 +0100 (MET) Resent-Message-Id: <199911150727.IAA28135@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA07044 for ; Fri, 12 Nov 1999 18:27:20 +0100 (MET) Received: from mail1.microsoft.com (mail1.microsoft.com [131.107.3.125]) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id SAA25949 for ; Fri, 12 Nov 1999 18:27:17 +0100 (MET) Received: from 157.54.9.101 by mail1.microsoft.com (InterScan E-Mail VirusWall NT); Fri, 12 Nov 1999 09:27:02 -0800 (Pacific Standard Time) Received: by INET-IMC-01 with Internet Mail Service (5.5.2650.21) id ; Fri, 12 Nov 1999 09:06:48 -0800 Message-ID: <783D93998201D311B0CF00805FEAA07B7E8FE5@RED-MSG-42> From: Manuel Fahndrich To: caml-list@inria.fr Subject: RE: Undefined labels Date: Fri, 12 Nov 1999 09:06:47 -0800 X-Mailer: Internet Mail Service (5.5.2650.21) Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 15 Nov 1999 08:27:55 +0100 Resent-To: caml-redistribution@pauillac.inria.fr This is the standard example for why we need a local open in the language. -Manuel -----Original Message----- From: Christian RINDERKNECHT [mailto:rinderkn@hugo.int-evry.fr] Sent: Friday, November 12, 1999 8:48 AM To: caml-redistribution@pauillac.inria.fr Cc: caml-list@inria.fr Subject: Re: Undefined labels Hello, > (Unix.fstat argument).st_kind > > Here, the function returns a structure, st_kind > is a label of that structure, but it is not known > in the calling module. Is there a syntax for this? Yes: (Unix.fstat argument).Unix.st_kind ^^^^ because the compiler doesn't know in what module to look-up for label [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. I recently started using classes in order to avoid this practical problem, since methods are in the scope of their object, not of the module embedding their class. But this doesn't work if the library you are using is not object-oriented, of course:) Best regards, -- Christian ----------------------------------------------------------------------- Christian Rinderknecht Phone +33 (0)1 60 76 44 43 Institut National des Télécommunications Fax +33 (0)1 60 76 47 11 Département Logiciels Réseaux (LOR) WWW 9, Rue Charles Fourier, F-91011 Évry Cedex