Re: [BLACKBOX] Ofront supporting for unsigned types

From: Oleg N. Cher <"Oleg>
Date: Thu, 26 Apr 2012 08:55:50 +0300

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

Norayr Chilingarian wrote:

> I think, may be, it should be possible to define SYSTEM.BYTE in Ofront's SYSTEM.h.
> i. e. not changing any of the existing types.

No, it is not so simple.
First, SYSTEM.BYTE type in Ofront is signed too.
This signifies that we'll not be able to write so:

VAR
        x: SYSTEM.BYTE;
BEGIN
        B.Init;
        B.BORDER(B.Green); B.PAPER(B.Black); B.CLS;
        FOR x := 0 TO 245 BY 2 DO
                B.INK(B.Yellow); B.PLOT(x, 127); B.DRAW(10, 10);
                B.INK(B.Magenta); B.PLOT(x, 37); B.DRAW(10, 10);
        END;

I've several compile-errors here for this code.

1. FOR x *** - control variable must be integer
2. 0 TO 245 *** - incompatible assignment (too big for unsigned byte)

As you see, it is traditional BYTE using in Oberon-languages.
I think the type SYSTEM.BYTE is provided not for expressions.
It's for accepting low-level compatibility between other types
(especially in procedures of input-output blocks of memory, etc).

And I think about unsigned types for expressions not as attempt
"to perfect Oberon language", but as to shift range of numeric
types from {-128..127} to {0..255} (etc), and that only with
one purpose - use such arithmetic where this is more effectively.

-- 
Oleg N. Cher
http://zx.oberon2.ru/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1917831363_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRib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aCBib2R5ICJT
SUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9fQAgeW91
----boundary-LibPST-iamunique-1917831363_-_---
Received on Thu Apr 26 2012 - 07:55:50 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:03 UTC