caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yotam Barnoy <yotambarnoy@gmail.com>
To: David Allsopp <dra-news@metastack.com>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocaml compiler documentation
Date: Thu, 3 Apr 2014 14:17:44 -0400	[thread overview]
Message-ID: <CAN6ygOnqGUKGOr4og=cp1cFp0GGZapWtJH0Q59Lua-2heNE2gw@mail.gmail.com> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9E0947428@Remus.metastack.local>

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

Wow that was awesome! Thanks so much for your help and encouragement, guys!

I think for this file I'll submit a simple PR with only a few minor
clarifications for the less obvious features. I'll also make an 'OCaml
Nuances' page in the wiki for listing some of these less well-known
features.

After that, I think I'll proceed to typing/typedtree.mli, which is the same
AST, only after the typechecker has added types to it.



On Thu, Apr 3, 2014 at 6:46 AM, David Allsopp <dra-news@metastack.com>wrote:

> Simon Cruanes wrote:
> > Le Thu, 03 Apr 2014, David Allsopp a écrit :
> > > Yotam Barnoy wrote:
> > > > 2. What is demonstrated in lines 114-117 regarding polymorphic
> variant
> > row fields:
> > > >
> > > >  | Rtag of label * bool * core_type list
> > > >        (* [`A]                   ( true,  [] )
> > > >           [`A of T]              ( false, [T] )
> > > >           [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
> > > >           [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )
> > > >         *)
> > > >
> > > > What does the bool value represent?
> > >
> > > It indicates that the constructor is constant, or that one of the
> > > types in the conjunction is "empty" (i.e. constant - I don't know what
> > > Jacques' terminology for that is!)
> >
> > I might miss something, but wouldn't this be more readable if a variant
> > was used instead of booleans? Say,
> >
> > type includes_constant =
> >     | IncludesConstant
> >     | DoesNotIncludeConstant
>
> Possibly (it certainly can't make any difference for efficiency, as type
> bool is simply a two-constructor variant itself!). I guess historically the
> worry would be conflicting names between different types, but that's not a
> problem now.
>
> > In addition, I never heard about conjunctions in variants, so I'm happy
> > Yotam started this initiative...
>
> +1!
>
> I already knew about conjunctions (it is worth perusing that section of
> the manual as most, if not all, of the weird corner cases are covered in
> there somewhere) but not how it was implemented in the parser/type checker!
>
>
> David
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 3316 bytes --]

  reply	other threads:[~2014-04-03 18:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 15:39 Yotam Barnoy
2014-03-31 17:06 ` Milan Stanojević
2014-03-31 17:51   ` Yotam Barnoy
2014-04-01 10:03     ` Mark Shinwell
2014-04-03  2:48       ` Yotam Barnoy
2014-04-03  6:18         ` Mark Shinwell
2014-04-03  8:42         ` Jeremy Yallop
2014-04-03  9:05         ` David Allsopp
2014-04-03 10:20           ` Simon Cruanes
2014-04-03 10:46             ` David Allsopp
2014-04-03 18:17               ` Yotam Barnoy [this message]
2014-04-03  9:10         ` Gabriel Scherer
2014-04-03 20:16         ` Alain Frisch
2014-04-04  7:39           ` François Bobot
2014-04-14  6:12           ` Mark Shinwell
2014-04-14  7:44             ` Alain Frisch

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='CAN6ygOnqGUKGOr4og=cp1cFp0GGZapWtJH0Q59Lua-2heNE2gw@mail.gmail.com' \
    --to=yotambarnoy@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.com \
    /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).