Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Frederic van der Plancke <fvdp@decis.be>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Stupid question
Date: Fri, 16 Jan 2004 11:25:58 +0100	[thread overview]
Message-ID: <4007BC36.3600A6DA@decis.be> (raw)
In-Reply-To: <16391.41836.251525.54048@ithif51.inf.tu-dresden.de>



Hendrik Tews wrote:
> 
> Brian Hurt writes:
> 
>    OK.  This makes more sense.  Well, except for the nitpicking detail that
>    true and false are not valid variant type identifiers, they should be True
>    and False.
> 
> There is a special exception: true, false, [], (), and :: are
> constructor names, see 6.3 Naming objects. One can ideed write
> 
> # type x = true of int | () of string | :: of float

But you better have a pair of types after '::' ;-)

# let x = true 123;;
val x : x = true 123
# let y = () "eh eh";;
val y : x = () "eh eh"
# let z = :: 1.5;;
Toplevel input:
# let z = :: 1.5;;
          ^^
Syntax error
# let z = 1.5 ::;;
Toplevel input:
# let z = 1.5 ::;;
                ^^
Syntax error
# let z = 1.5 :: 1.5;;
Toplevel input:
# let z = 1.5 :: 1.5;;
          ^^^^^^^^^^
This expression has type float * float but is here used with type float

Frédéric vdP

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-01-16 10:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-15  0:03 Brian Hurt
2004-01-15  3:57 ` skaller
2004-01-15  6:13   ` Brian Hurt
2004-01-15  8:37     ` Christophe Raffalli
2004-01-16  0:43   ` Jacques Garrigue
2004-01-16  2:35     ` Brian Hurt
2004-01-16  8:40       ` Hendrik Tews
2004-01-16 10:25         ` Frederic van der Plancke [this message]
2004-01-16 12:07           ` Alex Baretta
2004-01-16  5:41     ` Nicolas Cannasse

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=4007BC36.3600A6DA@decis.be \
    --to=fvdp@decis.be \
    --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