Tirifto on Nostr: Today, in my search for a way to create GUI applications without suffering, I have ...
Today, in my search for a way to create GUI applications without suffering, I have looked into Pascal, which seemed like a nice language with a mature environment for this purpose. 
Playing around with the language, I ran into an odd error: Pascal allows one to set boundaries for an array, and each boundary may be specified using a constant one has declared earlier. However, this doesn’t work if a type is declared for said constant.
After some time spent searching, I found a forum thread where the issue is explained thusly:
e.g. using a typed constant allows you to actually change the value of the constant.
Object Pascal offers two different sorts of consts: ‘proper’ consts that are constant (as you might expect), and typed consts that are initialized variables. Naming the latter sort ‘const’ is a frequent source of confusion for newcomers to Pascal, but it was introduced by Borland, and FPC preserves the same syntax for compatibility with Delphi.
So in this language, which has separate declarations for constants and variables, there is a non-obvious way to disguise the latter as the former, for historical reasons. If that’s any indication of what one may expect from the rest of Pascal…
… there’s no way! There’s just no way to make a GUI application without suffering, is there?!
#lang_en #GUI #Pascal #programming

Playing around with the language, I ran into an odd error: Pascal allows one to set boundaries for an array, and each boundary may be specified using a constant one has declared earlier. However, this doesn’t work if a type is declared for said constant.

After some time spent searching, I found a forum thread where the issue is explained thusly:
e.g. using a typed constant allows you to actually change the value of the constant.
Object Pascal offers two different sorts of consts: ‘proper’ consts that are constant (as you might expect), and typed consts that are initialized variables. Naming the latter sort ‘const’ is a frequent source of confusion for newcomers to Pascal, but it was introduced by Borland, and FPC preserves the same syntax for compatibility with Delphi.
So in this language, which has separate declarations for constants and variables, there is a non-obvious way to disguise the latter as the former, for historical reasons. If that’s any indication of what one may expect from the rest of Pascal…
… there’s no way! There’s just no way to make a GUI application without suffering, is there?!
