Search found 102 matches
- Sat May 04, 2019 3:49 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Type Test Inconsistency?
- Replies: 5
- Views: 33199
Re: Type Test Inconsistency?
Assume P2 is implemented in another module, say implementing T and its extensions (my actual use case); the code is perfectly valid with a qualident as case variable. Now a module client calls P2 "wrongly", and P2 fails silently. But the test-case should execute correctly with an IS type test. PROCE...
- Fri May 03, 2019 1:17 pm
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Type Test Inconsistency?
- Replies: 5
- Views: 33199
Type Test Inconsistency?
From real-world code, distilled down to a test case: MODULE M; IMPORT Main, Out; TYPE T = RECORD i: INTEGER END; T1 = RECORD(T) k: INTEGER END; R = RECORD t: T1 END; P = POINTER TO R; VAR p: P; PROCEDURE P2(VAR t: T); BEGIN t.i := 13; Out.String("T"); Out.Ln; CASE t OF T1: t.k := 4; Out.String("T1")...
- Tue Apr 30, 2019 5:53 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: 7.0.1 Fixes
- Replies: 1
- Views: 22167
7.0.1 Fixes
Type tests on expressions (e.g. array elements and individual fields of records) are handled correctly in IS expressions. Type tests using CASE statements can only be performed on (qualified) identifiers, not expressions. 1) Does this apply to all type tests, or only in leaf procedures? 2) Is deref...
- Sat Apr 27, 2019 1:25 pm
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Assignment to Pointer-referenced Variable
- Replies: 3
- Views: 26927
Re: Assignment to Pointer-referenced Variable
Then again...
... compiles and executes (prints 13 and 4).
Code: Select all
MODULE M;
IMPORT Main, Out;
TYPE
P = POINTER TO T;
T = RECORD
i: INTEGER
END;
VAR
p: P;
t: T;
BEGIN
t.i := 13;
p^ := t;
Out.Int(p.i, 0); Out.Ln;
p.i := 4;
Out.Int(p.i, 0); Out.Ln
END M.
- Sat Apr 27, 2019 11:06 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Assignment to Pointer-referenced Variable
- Replies: 3
- Views: 26927
Assignment to Pointer-referenced Variable
Code: Select all
MODULE M;
TYPE
P = POINTER TO T;
T = RECORD END;
VAR
p: P;
t: T;
BEGIN
p^ := t
END M.
- Tue Apr 16, 2019 3:26 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Disabling Interrupts
- Replies: 1
- Views: 21134
Disabling Interrupts
First, let me thank you for your patience answering my barrage of questions. Highly appreciated! Here's the next... How "atomic" is SYSTEM.PUT as regards interference by interrupts? In particular: (* irqICER, irqISER, irqSCBit: the ICER, ISER and bit (a SET) corresponding to the interrupt *) PROCEDU...
- Tue Apr 16, 2019 12:35 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Type Extensions Across Modules
- Replies: 5
- Views: 32318
Re: Type Extensions Across Modules
A programmer is able to extend any type exported from a module with or without access to the source code. Without the source code of M1 you would have no knowledge of the existence of i. If the author of M1 determines that T1.i is private then he can make any change he likes to T1 (remove i, change...
- Mon Apr 15, 2019 2:47 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Overhead of Record Parameters
- Replies: 1
- Views: 21069
Overhead of Record Parameters
MODULE M10; TYPE P = POINTER TO R; R = RECORD END; VAR p: P; r: R; PROCEDURE P1(r: R); END P1; PROCEDURE P2(VAR r: R); END P2; PROCEDURE P3(p: P); END P3; BEGIN P1(r); P2(r); P3(p) END M10. What are the differences in the overhead when calling the procedures? I would assume they are minimal, in par...
- Mon Apr 15, 2019 2:30 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Extended Type Formal VAR Parameters
- Replies: 5
- Views: 27039
Re: Extended Type Formal VAR Parameters
MODULE M8; TYPE T1 = RECORD i: INTEGER END; T2 = RECORD(T1) k: INTEGER END; VAR t1: T1; t2: T2; PROCEDURE P1(VAR t: T1); VAR t1: T1; BEGIN t1.i := 17; t := t1 END P1; BEGIN t2 := t1; (* illegal *) t2.i := 13; t2.k := 4; P1(t2); (* t2.i = 17, t2.k = 4 *) END M8. The t2 := t1 assignment is illegal, a...
- Sun Apr 14, 2019 1:30 am
- Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
- Topic: Extended Type Formal VAR Parameters
- Replies: 5
- Views: 27039
Re: Extended Type Formal VAR Parameters
Hm, thanks, yes, the Report is clear about this. Mr W's writing is succinct and precise as usual. I was mulling over the reason why pointers to an extended type cannot be passed as VAR parameters declared as pointer to a base type thereof. Is this the (or a) use case and problem the rule prevents? M...