Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe TROESTLER <debian00@tiscali.be>
To: la@iki.fi
Cc: "O'Caml Mailing List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Exceptions considered harmful
Date: Sun, 04 Jul 2004 22:16:07 +0200 (CEST)	[thread overview]
Message-ID: <20040704.221607.42992936.debian00@tiscali.be> (raw)
In-Reply-To: <20040704073050.GA907@la.iki.fi>

On Sun, 4 Jul 2004, Lauri Alanko <la@iki.fi> wrote:
> 
> an exception syntax that is closer to Haskell's monadic style: an
> expression either returns a value or raises an exception, so
> catching an exception is like pattern matching: there's one case for
> the returned value, others for possible exceptions:
> 
> try 
>   x <- foo ()
> in
>   bar ()
> unless
>   E1 -> handle1 ()
>   E2 -> handle2 ()

How is this sensibly different from OCaml' syntax?

try
  x <- foo();
  bar()
with
| E1 -> handle1()
| E2 -> handle2()

ChriS

-------------------
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-07-04 20:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040628143917.GA21847@fichte.ai.univie.ac.at>
     [not found] ` <Pine.LNX.4.44.0406290056580.1229-100000@localhost>
     [not found]   ` <20040628173400.GB26193@fichte.ai.univie.ac.at>
2004-06-29  1:02     ` skaller
2004-07-04  7:30       ` Lauri Alanko
2004-07-04 20:16         ` Christophe TROESTLER [this message]
2004-07-04 20:24         ` Michael Hicks
2004-07-05  3:42           ` skaller
2004-07-11 13:12       ` [Caml-list] " Richard Cole
2004-06-29 18:05 [Caml-list] " Brandon J. Van Every

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=20040704.221607.42992936.debian00@tiscali.be \
    --to=debian00@tiscali.be \
    --cc=caml-list@inria.fr \
    --cc=la@iki.fi \
    /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