BeginPackage["foo`"]; bar; Begin["`Private`"]; bar := bar[ $Context, $ContextPath]; End; EndPackage;
So I'd like to have all information about
foo` stored in an expression.
It may be useful in something like How can I include functions from a package into a CDF file? where the package is spread over many files.
DumpSaveis not portable enough
$ContextPath(everything what is not protected) together with all definitions so loading it will affect environment.
I can load it within additional
Begin/EndPackagebut I don't like it.
I don't know how to use
Language`functions to do this.
So I can cook up a workaround but I'd like to ask if I'm not missing something obvious here.
compressContext should take context name as input and output compressed
string which one can later
Get @ StringToStream @ Uncompress @ string.
Or whatever that can be used to load context back.