On 11 Dec 2002 at 3:27, Frank Heckenbach wrote:
[...]
The way it is done in the System unit is invalid as well :-)
type
Integer = Integer (16);
As above, this should mean an attempt to make a circular definition. (Of course, the System unit is full of nonstandard features anyway, so this is not a real problem.)
Since it is already working, is there really a need to change it?
[...]
Now, seeing this, I'm starting to doubt whether this syntax is useful. AFAICS, there is no easy and clean way to achieve what's wanted here. The following would be just as wrong, of course:
type Int16 = Integer (16); Integer = Int16;
The only way out might be to define Int16 in another module (here probably in the GPC module) and use it in the System unit.
For this reason (and also because `Integer (16)' is a little ambiguous, it can mean a BP-style type-cast in other contexts), I suggest to change the syntax. (IIRC, it was me who suggested it originally, so I can change it, can't I? ;-)
Yes, you can - but I can't see the point. Anyone who wants to be standards-compliant will not use either the existing or the proposed new syntax. For other people, the existing syntax does the job. There is nothing ambiguous in "Type foo = integer (n)", because if it is used in a type declaration (and that is the only place that it can be used), then it is clearly not a BP-style type-cast.
I guess it will affect some low-level units/modules (those that come with GPC which I'll change accordingly, of course, and maybe some of other's projects), hopefully not too many ...
Currently, we have:
Integer (n) Cardinal (n) Word (n) Boolean (n)
This could be changeg, e.g., to:
TypeOfSize (Integer, n) TypeOfSize (Word, n) TypeOfSize (Cardinal, n) TypeOfSize (Boolean, n)
This is fine - as (IMHO) is the original one. Both are non-standard. The original has 2 advantages - it is already working and being used, and, it doesn't require a new identifier. The new one might be "clearer" (it isn't, IMHO) and might be more "Pascalish" (I don't understand how, but others might). But we are really talking of replacing one non-standard feature with another. I say, let sleeping dogs lie.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/