Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Manuel Fahndrich <maf@microsoft.com>
To: caml-list@inria.fr
Subject: RE: anonymous record types in variants
Date: Mon, 15 Feb 1999 10:03:39 -0800	[thread overview]
Message-ID: <25983782061AD111B0800000F86310FE1026CB04@RED-MSG-42> (raw)


I also find this the major annoying feature of CAML records. I frequently
use variant datatypes with a number of fields. Without records, the field
order matters and has to be remembered when creating and accessing such
variants. Anonymous records would be ideal on variants, since they would not
introduce the extra level of indirection that you get when you declare an
explicit record type.

-Manuel 

-----Original Message-----
From: Don Syme [mailto:dsyme@microsoft.com]
Sent: Monday, February 15, 1999 2:30 AM
To: 'Christopher Jeris'; caml-list@inria.fr
Subject: RE: anonymous record types in variants



FTR, I've also had a few situations where it seemed most natural to write
similar constructs, but I couldn't.

Cheers,
Don
> 
> The argument of a variant type constructor cannot be an 
> anonymous record
> type, i.e.:
> 
>   type foo = One of {one: int} | Two of {two: string}
> 
> is rejected at the first {.  Of course this is easy to work 
> around, just
> give the record types names:
> 
>   type foo_one = {one: int}
>   type foo_two = {two: string}
>   type foo = One of foo_one | Two of foo_two
> 
> But, just out of curiosity, is there a quick explanation of 
> why it is this
> way?
> 
> thanks & peace,
> 
> Chris Jeris	MIT math grad student and novice OCaml music programmer
> 




             reply	other threads:[~1999-02-16  7:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-15 18:03 Manuel Fahndrich [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-02-22 16:37 Manuel Fahndrich
1999-02-22 17:56 ` Pierre Weis
1999-02-18 14:03 Don Syme
1999-02-18 10:13 Frank A. Christoph
1999-02-16 17:40 Don Syme
1999-02-15 10:30 Don Syme
1999-02-12 20:53 Christopher Jeris
1999-02-16 10:57 ` Anton Moscal
1999-02-17  9:32 ` Xavier Leroy
1999-02-17 18:09   ` Christopher Jeris
1999-02-17 19:14     ` Didier Remy
1999-02-22  8:44   ` Anton Moscal
1999-02-22 13:00     ` Pierre Weis

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=25983782061AD111B0800000F86310FE1026CB04@RED-MSG-42 \
    --to=maf@microsoft.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