Stream: helpdesk (published)

Topic: Modify global variable in package


view this post on Zulip Timothy (Apr 18 2022 at 10:03):

Hi All,

I'm trying to write a package which modifiies a global variable from another package (push!ing to a vector, specifically). Adding @info calls before and after modifying indicates it works. However, they are only emmited during precompilation, and when loading the package nothing seems to happen and the variable is not modified

So, am I correct in guessing the way to make this work would be by preventing the statement from being precompiled? If so, how might I accomplish this?

view this post on Zulip Sebastian Pfitzner (Apr 18 2022 at 10:04):

put it into __init__

view this post on Zulip Timothy (Apr 18 2022 at 10:08):

Ah yes, I'd forgotten about that. Thanks :smile:


Last updated: Nov 22 2024 at 04:41 UTC