The idea is you create a module – Foo
– in some anonymous workspace.
// i.e. in order to not have to overwrite the module if it fails
module _anon_uuid
module Foo
if rand() < 0.5
bar() = "Hello, World."
else
error("Explode")
end
end
end
Is there a way to then inject this encapsulated module into some other Module?
in psuedocode:
module Fizz
cur_module = parse(<string_representation_of_module>)
cur_sub_module = nothing
for cur_attempt in 1:10
try
cur_sub_module = @make_encapsulated_module cur_module
catch
include("hot_fix_$(cur_attempt).jl")
continue
end
break
end
( cur_sub_module == nothing ) && error("nothing worked!")
@ingest_module cur_sub_module
end