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 XAA05292 for caml-red; Mon, 21 Aug 2000 23:42:18 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA03588 for ; Mon, 21 Aug 2000 23:41:46 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e7LLfhf20722; Mon, 21 Aug 2000 23:41:43 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA05715; Mon, 21 Aug 2000 23:41:43 +0200 (MET DST) From: Pierre Weis Message-Id: <200008212141.XAA05715@pauillac.inria.fr> Subject: Re: Question on language design (keywords vs Pervasives) In-Reply-To: <877l9apf9z.fsf@localhost.localdomain.> from John Prevost at "Aug 21, 100 03:47:52 pm" To: jmp@arsdigita.com (John Prevost) Date: Mon, 21 Aug 2000 23:41:43 +0200 (MET DST) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr > >>>>> "pw" == Pierre Weis writes: > > pw> You're right, there is no really good example that uses > pw> redefinition of raise. That's why the advantage to be able to > pw> redefine it may overcome the inconvenience of not being always > pw> sure of its meaning. > > Actually, I just thought of one. :) If you redefine raise in a > special way, you could have it report that it was raising exceptions, > even if those exceptions are later caught. Might be good for > analyzing your code. Mm. I don't think it could be considered ``good for analyzing your code'' if you compare to real tools such as the replay debugger (dynamic analysis) or Francois Pessaux's exception analyzer (static analysis). > pw> You're right, we don't want to have zillions of keywords. On > pw> the other hand, you also need to have some level of confidence > pw> into the words you use in the language, otherwise you can > pw> write horrors as the famous > > pw> if else then else else then > > pw> when then and else are not reserved. > > Right. But I don't think this is necessarily the case for raise. I > just gave a good example above. There's also the possibility of > somebody who could really care less about raising exceptions most of > the time (e.g. me) but who has some code which performs an operation > named "raise". In that context, having to fight the system to get > around it is bad. But reading code that uses ``raise'' all over the place to do many things other than raising exceptions could also be extreamely confusing... > There's always a tension here. For example, when I'm writing PL > implementations, the fact that "type" is a keyword is rather > upsetting. But, I can deal--especially because I know that O'Caml > doesn't have that many gratuitous keywords--everything's there for a > reason. > > John. Exactly, that's why I explained the reasons why we used to have raise as a keyword, just to get a cleaner language: nothing gratuitous here, the notion of exception raising is considered important and worth a keyword to handle them (try) and a keyword to throw them (raise). Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/