Personally, I'd prefer the
var section approach as well - what
@creaothceann suggested. Declaring these in
var with an attribute makes the most sense to me, since they really are variables with static storage.
And here's the bonus: this naturally extends to inline variable declarations too:
var x: Integer = 1; static;
or even shorter with type inference:
As for
absolute - that can be added to inline vars too:
var x: Integer := 1;
var a: TMyRec absolute x;
Now, about the keyword itself -
static,
persistent, or
keep?
I'd go with either
static or
keep. Both are short, easy to type, and immediately clear in meaning.
persistent is descriptive but annoying to type (and easy to mistype) - not a great quality for a keyword you'll use regularly. Between the two,
static has prior art in C/C++ and maps to the exact same concept.
keep is a fresh alternative if we want to avoid the C baggage. Either way, both are better than
persistent purely from a practical standpoint.