Re: CAPS again

From: [at]} <Bob>
Date: Fri, 17 Sep 2004 18:46:23 +0100

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

>----- Original von: Bob Walkden <bob{([at]})nowhere.xy
>
>> Hi,
>>
>> There is no "undefined result". It is very much defined.

>
>Where it it defined?
>
>The language report says "CAP(x) character type type of x
> x is a Latin-1 letter: corresponding capital letter".
>
>I can't see where it defines the result if x is not a Latin-1 letter.

So it seems we have a different interpretation of "undefined". If I understand you correctly, definition is a question of documentation. If that's so, then you're right. But for me this is not an "undefined result" but a lack of documentation. But an error in the documentation is something totally different from an error in the compiler or the implementation of the function CAP.

IMHO, an "undefined" result is something different. In the original Oberon, variable values were uninitialized on creation and had to be initialized by the program actively. IF you read the value of an uninitialized variable, the result is undefined. It MAY be of the type of the variable, but it may be not, too. This is one way I understand the word "undefined". So, if CAP in any instance would produce a result that is <MIN(CHAR) or >MAX(CHAR), then this would be the case. As long as the result is of type CHAR, the result is defined.

Another explanation of "undefined" would be, if it was unpredictable. But it is very much predictable, so this definition of "undefined" doesn't fit, too.


>> So maybe you should do some studies in Assembler then, the
>> explanation why CAPS is that incredible fast (compared to
>> Strings.Upper) has already been given by Chris Burrows, IIRC.

>
>Thankyou for the suggestion. I have several years experience of
>writing professionally in assemblers for ICL and IBM mainframes,
>and for PCs, although I have not done so for some years.
>
>As Tei has pointed out, the particular method that Chris describes
>is not very portable and not very international. However, the language
>report does specify Latin-1, so it seems that the language definition
>contains an implementation bias.

That's right. The language definition did not promise to do CAP on EBCDIC, nor did it promise CAP on chinese letters. It promised, however, CAP on Latin-1.

I just tried the whole thing in Plugin Oberon, and the results for the following program:

MODULE Test;
        IMPORT Out;
        PROCEDURE Do*;
        VAR a: CHAR;
        BEGIN
                Out.Int(ORD(CAP("a")),2);Out.Ln();
                Out.Int(ORD(CAP("A")),2);Out.Ln();
                Out.Int(ORD(CAP(" ")),2);Out.Ln();
        END Do;

END Test.
Test.Do

Are:

65
65
 0

The same is true for Oberon4.

For compatibility reasons I agree, BB should have the same behavior.

But I personally think that the BB behavior is more logical than the O4 and the OP behavior.

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-364885243_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4tLS0tLSBPcmlnaW5hbCB2b246ICBCb2IgV2Fs
a2RlbiA8Ym9iQHdlYi1vcHRpb25zLmNvbT46XHBhcg0KPlxwYXINCj4+IEhpLFxwYXINCj4+XHBh
cg0KPj4gVGhlcmUgaXMgbm8gInVuZGVmaW5lZCByZXN1bHQiLiBJdCBpcyB2ZXJ5IG11Y2ggZGVm
aW5lZC5ccGFyDQo+XHBhcg0KPldoZXJlIGl0IGl0IGRlZmluZWQ/XHB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HRoYXQgbW9kZXJhdGlvbiB3aWxsIG9mdGVuIGNh
dXNlIHNvbWUgZGVsYXksIGluIHBhcnRpY3VsYXIgb3ZlciB3ZWVrZW5kcyBvciBob2x5ZGF5c319
ADAuYWN0


----boundary-LibPST-iamunique-364885243_-_---
Received on Fri Sep 17 2004 - 19:46:23 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:36 UTC