the.bay.news

How to avoid multiple __init__ calls?

Julia Programming Language
How to avoid multiple __init__ calls?
I use project wide config used by many modules. And sometimes I observe its __init__ function called many times, I assume during compilation. How to avoid that is the proper way to use ccall(:jl_generating_output, Cint, ()) == 1 && return nothing? The config module Config now::Date = Date(0) const clear_cache_cbs = Function[] clear_cache!() = for cb in clear_cache_cbs; cb() end clear_cache!(cb::Function) = push!(clear_cache_cbs, cb) set_now(d::Date) = begin Config.now == d && return Co...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.