Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alex Baretta <alex@barettadeit.com>
To: Richard Jones <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Strange parsing of with-clauses
Date: Mon, 29 Nov 2004 17:46:12 +0100	[thread overview]
Message-ID: <41AB5254.6050004@barettadeit.com> (raw)
In-Reply-To: <20041129162640.GA27030@annexia.org>

Richard Jones wrote:
> Not a big problem, but strange nevertheless:
> 
> # exception E of string * string;;
> exception E of string * string

Exception E is a constructor accepting two arguments, not a single tuple 
of two elements.

> # let f () = raise (E ("a", "b"));;
> val f : unit -> 'a = <fun>
> # try f (); failwith "Not found" with E (a,b) -> (a,b);;
> - : string * string = ("a", "b")
> # try f (); failwith "Not found" with E t -> t;;
>                                        ---
> The constructor E expects 2 argument(s), but is here applied to 1 argument(s)
> 
> (In my actual code I want to return the thrown tuple to the caller).

This is the point.

Try

exception E of (string*string)


or

type thrown_tuple = string * string
exception E of thrown_tuple

> Rich.
> 

Alex

-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>


  reply	other threads:[~2004-11-29 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-29 16:26 Richard Jones
2004-11-29 16:46 ` Alex Baretta [this message]
2004-11-29 17:04 ` [Caml-list] " Olivier Andrieu
2004-11-29 19:41   ` Stefan Monnier

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=41AB5254.6050004@barettadeit.com \
    --to=alex@barettadeit.com \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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