caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@best.com>
To: caml-list@inria.fr
Subject: RE: Undefined labels
Date: Mon, 15 Nov 1999 16:30:20 -0800 (PST)	[thread overview]
Message-ID: <Pine.BSF.4.10.9911151627270.23897-100000@shell5.ba.best.com> (raw)
In-Reply-To: <783D93998201D311B0CF00805FEAA07B7E8FE5@RED-MSG-42>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1861 bytes --]

On Fri, 12 Nov 1999, Manuel Fahndrich wrote:
>
> This is the standard example for why we need a local open in the language.
>
> -Manuel

Let me second that motion. Coming from Ada, I always wondered why OCaml
doesn't allow you to restrict the scope of open, instead of putting it
always at module level.

-- Brian

>
>
> -----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
>



  reply	other threads:[~1999-11-16 18:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-12 17:06 Manuel Fahndrich
1999-11-16  0:30 ` Brian Rogoff [this message]
1999-11-19 14:35   ` Anton Moscal
1999-11-17  9:54 ` Gerard Huet
1999-11-18 20:08   ` David Brown
1999-11-19 16:18     ` Markus Mottl
1999-11-20 23:49       ` Packages? skaller
  -- strict thread matches above, loose matches on Subject: below --
1999-10-14  0:58 Announcement: automatically resizing arrays Markus Mottl
1999-11-11 11:39 ` Undefined labels skaller
1999-11-12  9:28   ` Jean-Christophe Filliatre
1999-11-12 23:01     ` skaller
1999-11-12  9:54   ` William Chesters
1999-11-12 12:47   ` Christian RINDERKNECHT
1999-11-12 17:11     ` Jean-Francois Monin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.10.9911151627270.23897-100000@shell5.ba.best.com \
    --to=bpr@best.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).