From: Jacques Carette <carette@mcmaster.ca>
To: Luc Maranget <luc.maranget@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] polymorphic variants, long form
Date: Tue, 20 Jan 2009 13:04:11 -0500 [thread overview]
Message-ID: <4976121B.3040109@mcmaster.ca> (raw)
In-Reply-To: <20090120173958.GA24589@yquem.inria.fr>
Luc Maranget wrote:
>> What is the proper 'long name' of a polymorphic variant?
>> module S = struct type a = [`Foo of int] end
>>
>> How do I refer to `Foo without opening S? Both S.`Foo and `S.Foo are
>> syntax errors.
>>
>> Jacques
>>
>
> 'Foo does the job, it does not refer to any previous type definition.
>
> % ocaml
> Objective Caml version 3.11.0
>
> # `Foo;;
> - : [> `Foo ] = `Foo
>
Just a few minutes after I sent my email, I remembered the answer
myself: unlike normal variants, polymorphic variants are not scoped but
affect the namespace in a GLOBAL way. Both extremely convenient and
non-modular at the same time.
Jacques
next prev parent reply other threads:[~2009-01-20 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-20 17:37 Jacques Carette
2009-01-20 17:39 ` [Caml-list] " Luc Maranget
2009-01-20 18:04 ` Jacques Carette [this message]
2009-01-21 9:39 ` Romain Bardou
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=4976121B.3040109@mcmaster.ca \
--to=carette@mcmaster.ca \
--cc=caml-list@inria.fr \
--cc=luc.maranget@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