Accessing static data of functions
WebFreak001
d.forum at webfreak.org
Tue Oct 19 14:08:31 UTC 2021
On Tuesday, 19 October 2021 at 13:36:24 UTC, Mike Parker wrote:
> On Tuesday, 19 October 2021 at 11:12:12 UTC, Timon Gehr wrote:
>
>>
>> The OP has a well-motivated use case. I don't understand at
>> all why you are being this dismissive. The inability to
>> serialize static variables scoped inside functions is clearly
>> an arbitrary limitation that should be lifted.
>
> Sorry that I came off that way. I'm not opposed to the feature
> at all. If someone wants to implement it, I expect it can get
> by without a DIP. An enhancement request in Bugzilla should
> suffice.
>
> I was responding to the OP's concern about users of the
> library. Based on my experience, I just can't imagine it ever
> being an issue. Of course, I may well be wrong.
I made a library before that would store the whole application
state in a file, restart the application when an update on the
filesystem exists and restore the state from the file
automatically on startup in the new process using traits. I only
had some fixed global variables but if you made that a library I
can see serializing static variables as a good inclusion.
More information about the Digitalmars-d
mailing list