Hello,
perhaps somebody can help to clarify the following two questions:
1) Is the comparision with `=' or `<>' of structured variables okay in ISO Pascal? ISO 10206 6.8.3.5 only says that the types to be compared must be compatible.
If not, this might be a reasonable extension (already offered by some compilers, *not* including Borland Pascal;).
2) In GPC strings, the schema discriminant "Capacity" is accessible as a "record field" of the string. Is this okay by ISO 10206, and should it be done for other schemata this way, too? And how to tread the "length" field of a string? ISO 10206 6.4.3.3 does not say anything about that. I could imagine the string schema type to be something similar to
Type String ( Capacity: Integer ) = record length: Integer; String: packed array [ 1..Capacity ] of Char; end (* String *);
except that the "String" field is automatically dereferenced.
Thanks for your help,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970420] - http://home.pages.de/~gnu-pascal/ [970125]
Is the comparision with `=' or `<>' of structured variables okay in ISO Pascal? ISO 10206 6.8.3.5 only says that the types to be compared must be compatible.
If not, this might be a reasonable extension (already offered by some compilers, *not* including Borland Pascal;).
I don't know what is okay in ISO Pascal :-(. But I do have a simple question. How do you want to compare structured variables? Compare member by member? I knew a very fine programming language (ELAN) in which it was possible to define your own operator (`=', `<>' or whatever you wanted). Is it possible to have this as an extension to Pascal?
Bye, Nils