Re: CAPS again

From: René A. Krywult <"René>
Date: Thu, 16 Sep 2004 12:11:14 +0200 (DFT)

----boundary-LibPST-iamunique-857313447_-_-
Content-type: text/plain


>> I still think that it's the caller's business to assure that the
>> arguments he calls a procedure with are checked before he calls that
>> procedure.

>
>surely one of the major reasons for using Pascal-like languages is
>type-safety, which drastically reduces the need for such run-time
>checks by the programmers.


The last mail I only provided a "smart alec" answer to this paragraph. Re-reading it, I thought that a more thorough explanation is needed.

The idea of "Pascal-like languages" is: Don't do at runtime, what you can already do at compile-time. Type-safety-checks can ALWAYS be done at runtime.

But just think fo the following code snippet:

PROCEDURE Test;
VAR a,b : CHAR; c:INTEGER;
BEGIN
    a:="A";
    c:3;
    b: R(ORD(a)-c);
    CAP(b);
END Test

How should the compiler have any chance to secure AT COMPILETIME that this does not compile? And this is only a very easy example. We could think of one where the computations for our "b" takes several hundred lines of code and span some procedures or even modules!

Now, since this is not something that can be covered at compile-time, it needs checking at runtime. There is simply no way around that!

So, the next question is: WHO should do the runtime-checking? Should it be done by language inherent predefined functions, or by modules calling those predefined functions?

And per definitionem, predefined functions need to be FAST above all. And we already covered that issue.

Rene


-------------------------------------------
Versendet durch AonWebmail (webmail.aon.at)
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-857313447_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmY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