From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA01945 for caml-red; Mon, 21 Aug 2000 22:24:58 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA32489 for ; Mon, 21 Aug 2000 18:44:29 +0200 (MET DST) Received: from localhost.localdomain (brian-boitano54.zip.com.au [210.23.147.54]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e7LGiKb24179; Mon, 21 Aug 2000 18:44:25 +0200 (MET DST) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id CAA02339; Tue, 22 Aug 2000 02:44:25 +1000 Message-ID: <39A15C69.D2A3A9B9@maxtal.com.au> Date: Tue, 22 Aug 2000 02:44:25 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Pierre Weis CC: reig@dcs.gla.ac.uk, caml-list@inria.fr Subject: Re: Question on language design (keywords vs Pervasives) References: <200008201901.VAA17272@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@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