I am using LocalSymbol to store some database credentials. I put a statement like this in a user-level autoload package:
$PostgresCredentials = LocalSymbol @ "DefaultPostgres"; This returns unevaluated when this package is autoloaded (i.e. it evaluates to LocalSymbol @ "DefaultPostgres"). Evaluate does not fix the issue.
If I reload the package manually after my session has started, then $PostgresCredentials correctly pulls the LocalSymbol. And of course if I define it with SetDelayed it will work.
I am just wondering what the problem is. Is it possible to access a LocalSymbol at the autoload stage?
.mfile to/from$UserBaseDirectory/ApplicationData/YourPackageName. UsePut/Getto do this, notExport/Import.Export/Importdoes not work during initiailzation. A nice way is to just put an association with string keys into that.mfile. $\endgroup$LocalSymbolhas trouble with paths that contain spaces. Windows encourages usernames with spaces, which means that LocalSymbol's default storage location will often have spaces on Windows ... $\endgroup$Getsuggestion instead. $\endgroup$