Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Stefan Monnier" <monnier+lists/caml/news/@tequila.cs.yale.edu>
To: caml-list@inria.fr
Subject: Re: Objects contrib: new URL ...
Date: 17 Jun 1999 14:44:05 -0400	[thread overview]
Message-ID: <5lg13q4qh6.fsf@tequila.cs.yale.edu> (raw)
In-Reply-To: <14185.11632.214915.820706@virtualc5.pa.dec.com>

>>>>> "Fabrice" == Fabrice Le Fessant <fessant@pa.dec.com> writes:
> At the end of this message, you will find a patch to apply on
> patch.cast to raise a Oo.CastFailure exception with the information
> on the file and the line number where the exception was raised.

I have to agree with Jacques:  using a match construct (i.e. `typecase')
rather than a `cast' is cleaner.  It makes it a lot more obvious that the
cast might fail and in the case where you want to deal with several
alternatives, a `typecase' is exactly what you want, whereas using `cast'
would be very awkward (using handlers all over the place).
Of course a `cast' is a little better in the case where you *know* that
it will succeed, but the textual overhead of a `typecase' does not seem
significant.

> (should the compiler allow "x.(-1)" in a program as it currently does?),

No it shouldn't.  And type-systems are being developed that catch those uses
(pushing array bounds checking either to compile-time or (when the analysis is
not powerful enough) to the programmer (to insert the checks by hand)).


	Stefan




  reply	other threads:[~1999-06-18 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-15 21:45 Objects contrib Fabrice Le Fessant
1999-06-16  8:13 ` Vyskocil Vladimir
1999-06-16 15:56 ` Objects contrib: new URL Fabrice Le Fessant
1999-06-17  2:26   ` Jacques GARRIGUE
1999-06-17 17:16     ` Fabrice Le Fessant
1999-06-17 18:44       ` Stefan Monnier [this message]
1999-06-18  1:19       ` Jacques GARRIGUE
1999-06-21 11:41 Don Syme

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=5lg13q4qh6.fsf@tequila.cs.yale.edu \
    --to=monnier+lists/caml/news/@tequila.cs.yale.edu \
    --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