Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __init__()


Should also mention that it comes with an ABI bump,
which means that you'll need to clean and re-bootstrap.

On Sun, 28 Jun 2015 14:34:28 -0700, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:

> __init__ functions are now working.
> 
> Any function named __init__ will be called before
> main(), allowing you to initialize your library,
> set up custom formatters for your data types, open
> files, etc.
> 
> These initializers are called in reverse topological
> order, which means that all of your dependencies will
> have had their initializers called (if they have them)
> before yours are called. For example:
> 
>     use std
>     const __init__ = {
>         use_std()
>     }
> 
> Is perfectly valid, because it's guaranteed that any
> initialization done in 'std' is finished before the
> __init__ function in question is called.
> 
> Disclaimer:
> 
> Magical pre-main code can be confusing, Please use
> gently. Side effects include confusion and internal
> bleeding. Do not take orally. Not to be used for the
> other use.
> 
> -- 
>     Ori Bernstein
> 


-- 
    Ori Bernstein

References:
__init__()Ori Bernstein <ori@xxxxxxxxxxxxxx>