Version française
Home     About     Download     Resources     Contact us    
Browse thread
Question on language design (keywords vs Pervasives)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <jmp@a...>
Subject: Re: Question on language design (keywords vs Pervasives)
>>>>> "pw" == Pierre Weis <Pierre.Weis@inria.fr> 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.

    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.

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.