Prof A Olowofoyeku (The African Chief) wrote:
This program does not compile. Shouldn't it?
Program attribute_bug;
TYPE Int8 = Integer attribute ( Size = 8 );
WordRec : RECORD Lo, Hi : Cardinal attribute ( Size = 8 ); END;
LongRec = PACKED RECORD Lo, Hi : Cardinal attribute ( Size = 16 ); END;
Begin Writeln ('OK'); End.
Attributes currently don't work in record fields etc. It would be extra effort to recognize them (syntactically). But since one can always declare a type with attributes (such as `Int8') and use this in the record, I'm not conviced whether I should do it ... One reason against it is that it's not possible in arrays, sets and files because then the following would be ambiguous (does the attribute belong to the array of the component type?). So it might be more consistent to not allow it in any structured types. type foo = array [1 .. 2] of Integer attribute (...); Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707