Or maybe they simply had the/a "const" segment in mind. Keep in mind that TP lived in a segmented world.
Quote from: marcov on May 24, 2020, 10:57:32 pmOr maybe they simply had the/a "const" segment in mind. Keep in mind that TP lived in a segmented world.But, there was no "const" segment back then. It was all you can read and write as long as it's not more than 64K.
The object files had various segments which were typically grouped and used for different things: embedded systems wanted read-only data to be in ROM as an example.And you also have to allow that in the 90s people expected segmented architictures to be used properly, and the x86 descriptor specifically had a r/w bit for data.
Yes but, when I wrote about there not being "const" segments, I was thinking about Turbo Pascal in the MS-DOS world. That's where the "typed constants" fantasy originated.
Quote from: MarkMLl on May 25, 2020, 08:54:53 amThe object files had various segments which were typically grouped and used for different things: embedded systems wanted read-only data to be in ROM as an example.And you also have to allow that in the 90s people expected segmented architictures to be used properly, and the x86 descriptor specifically had a r/w bit for data.Yes but, when I wrote about there not being "const" segments, I was thinking about Turbo Pascal in the MS-DOS world. That's where the "typed constants" fantasy originated.
Yes, whatever they had in mind for the future, a new keyword (or keywords, like "static var") would be an elegant solution.
Quote from: Zoran on May 25, 2020, 02:17:02 pmYes, whatever they had in mind for the future, a new keyword (or keywords, like "static var") would be an elegant solution.You can use VAR for initialized constants since D4/FPC2.
But are they static, i.e. does the value persist next time control returns in-scope?
You can use VAR for initialized constants since D4/FPC2.
Quote from: marcov on May 25, 2020, 02:24:02 pmYou can use VAR for initialized constants since D4/FPC2.Make that TP1. And forget about var.AFAIK it was Anders who introduced it. Correct me if I am wrong again.