So how i use it to specify addresses to the variables, declared in the same block ?
var
a, b: Utf32char;
c, d: array [0..3] of byte absolute ???;
c should be mapped to a, d should be mapped to b. They should be declared in one declaration, as they must share the datatype. Using workarounds, like adding boilerplate of creating a named type when it is not needed, would only stress how the syntax was broken by design, being disfunctional without workarounds.
That's what "absolute" is for.
Thank you i know. Just the syntax is broken, making simple things impossible without falling back to workarounds.
The example you provided is senseless.
No it is not. It has perfect sense.
I repeat: c should be mapped to a, d should be mapped to b. They should be declared in one declaration, as they must share the datatype. Using workarounds should not be needed.
There is no need to declare two overlays ("c" and "d" in your example above" of the same type) on top of another variable.
You did not read what you quoted, did you? Okay, i repeat yet again. There is to be no overlaying the same variable.
Quote:
c should be mapped to a, d should be mapped to b. In your example, the sensible thing would be to declare something along the lines of:c : array[0..3] of byte absolute a;
You did not read what you quoted, did you? Okay, i repeat yet again.
Quote:
They should be declared in one declaration, as they must share the datatype.The address of a variable is NOT part of datatype. Making variable address part of datatype was... very wrong, if you don't like ugly.
As you stated, the address of a variable is not part of its datatype but, the address of a variable is definitely part of its definition.[/quote]
No. The address of the variable became part of the datatype definition put inside variable declaration (not merely definition).
Otherwise, if that is not part of datatype definition, show me how to make two variables declared together be mapped to differen addresses.
var c, d: array [0..3] of byte absolute ???;
The proper syntax design, putting attributes where they belong, allows it naturally.
var c origin a, d origin b: array [0..3] of byte;
There already is "threadvar", and it is not being put after the variable name. Implementing a similar feature with different syntax pattern would not be nice.
Sure, it could be done by using a keyword such as "static" as a "prefix" (instead of threadvar.) There is more than one way to skin a cat.
Having two ways is rarel good - it usually shows that one of the ways is worse and a way better had to be added.
For example, putting overrode variable address after the related variable name was a good way to skin a cat.
And making overrode address part of the datatype, which in Pascal is intended to be shared by several variables, was bad way to skin a cat.
But maybe intentionally bad.