From: John Max Skaller <skaller@maxtal.com.au>
To: Pierre Weis <Pierre.Weis@inria.fr>
Cc: reig@dcs.gla.ac.uk, caml-list@inria.fr
Subject: Re: Question on language design (keywords vs Pervasives)
Date: Tue, 22 Aug 2000 02:44:25 +1000 [thread overview]
Message-ID: <39A15C69.D2A3A9B9@maxtal.com.au> (raw)
In-Reply-To: <200008201901.VAA17272@pauillac.inria.fr>
Pierre Weis wrote:
> The ``users can rebind'' argument is definitively what we intended
> when we decided to allow the rebinding of usual operators (infix or
> prefix symbols, such as +, -, *, ...). For ``raise'' this is not so
> clear, since redefining ``raise'' is a very bad idea to obtain a
> readable Caml program.
I'm not sure I agree with that. If raise is the _standard_
way to raise an exception, then it _should_ be rebindable (and be
defined
in terms of a more primitive function). The reason is precisely
to permit hooking it by the user, which is an extremely common
requirement.
For example, to introduce some extra logging.
In C++, exceptions are raise by a keyword 'throw', and it
is a pain, because good practice dictates NOT to ever raise an
exception directly with 'throw', but to call a (template) function
usually defined to simply raise the exception (using throw).
This permits replacing the function to, for example, print an
error message to stderr, as well as throwing the exception.
The problem is, this doesn't work for any third party code,
or even one's own code, if the idea occurs to one belatedly.
--
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net
next prev parent reply other threads:[~2000-08-21 20:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-18 2:07 Fermin Reig
2000-08-19 16:57 ` Frank Atanassow
2000-08-20 19:01 ` Pierre Weis
2000-08-20 19:55 ` John Prevost
2000-08-21 8:58 ` Pierre Weis
2000-08-21 19:47 ` John Prevost
2000-08-21 21:41 ` Pierre Weis
2000-08-21 16:44 ` John Max Skaller [this message]
2000-08-21 21:24 ` Pierre Weis
2000-08-22 0:38 ` Kwangkeun Yi
2000-08-22 2:25 ` John Max Skaller
2000-08-22 9:08 ` Pierre Weis
2000-08-22 8:31 ` Pierre Weis
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=39A15C69.D2A3A9B9@maxtal.com.au \
--to=skaller@maxtal.com.au \
--cc=Pierre.Weis@inria.fr \
--cc=caml-list@inria.fr \
--cc=reig@dcs.gla.ac.uk \
/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