caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Jacques Carette <carette@mcmaster.ca>
Cc: OCaML Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Unexpected parsing
Date: Fri, 25 Jan 2013 18:48:23 +0100	[thread overview]
Message-ID: <CAPFanBHvTOdq_NvZihDPNjiEtAT6VdgwuKTOSHTLeXc+1LAOcQ@mail.gmail.com> (raw)
In-Reply-To: <CAMoPVjeejVxJs6e5biBDyKi22oJjYhwazEWxEEb0p9me-4oFeg@mail.gmail.com>

"true" and "false" being defined as keywords by the OCaml lexical
conventions ( http://caml.inria.fr/pub/docs/manual-ocaml/lex.html ),
it seems perfectly reasonable not to parse them as identifiers.

(That the implementation is overly permissive in accepting their use
in exotic way is another matter.)

On Fri, Jan 25, 2013 at 7:46 AM, Arnaud Spiwack
<Arnaud.Spiwack@lix.polytechnique.fr> wrote:
> Quite :
>
> # type drole = true of drole | false of drole*drole | HAHA;;
> type drole = true of drole | false of drole * drole | HAHA
> # false (false (true HAHA, HAHA), true (true (true (true HAHA))));;
> - : drole = false (false (true HAHA, HAHA), true (true (true (true HAHA))))
>
>
>
> On 25 January 2013 00:00, Eric Cooper <ecc@cmu.edu> wrote:
>>
>> On Thu, Jan 24, 2013 at 05:26:12PM -0500, Jacques Carette wrote:
>> > Why is
>> > > true ;;
>> > parsed as Pexp_construct rather than Pexp_ident ?  [This is Ocaml 4.01].
>>
>> Perhaps to be consistent with
>>     type bool = false | true
>>
>> --
>> Eric Cooper             e c c @ c m u . e d u
>>
>> --
>> 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
>>
>

      reply	other threads:[~2013-01-25 17:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 22:26 Jacques Carette
2013-01-24 23:00 ` Eric Cooper
2013-01-25  6:46   ` Arnaud Spiwack
2013-01-25 17:48     ` Gabriel Scherer [this message]

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=CAPFanBHvTOdq_NvZihDPNjiEtAT6VdgwuKTOSHTLeXc+1LAOcQ@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=carette@mcmaster.ca \
    /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).