Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the __init__ function to publish a new release #3

Open
Leticia-maria opened this issue Jan 16, 2022 · 0 comments
Open

Correct the __init__ function to publish a new release #3

Leticia-maria opened this issue Jan 16, 2022 · 0 comments

Comments

@Leticia-maria
Copy link
Owner

Leticia-maria commented Jan 16, 2022

help?> __init__
search: __init__

  __init__

  __init__() function in your module would executes immediately after the module is loaded at runtime for the first time (i.e., it is only called once and only after all statements in the module have
  been executed). Because it is called after fully importing the module, __init__ functions of submodules will be executed first. Two typical uses of __init__ are calling runtime initialization
  functions of external C libraries and initializing global constants that involve pointers returned by external libraries. See the manual section about modules for more details.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  const foo_data_ptr = Ref{Ptr{Cvoid}}(0)
  function __init__()
      ccall((:foo_init, :libfoo), Cvoid, ())
      foo_data_ptr[] = ccall((:foo_data, :libfoo), Ptr{Cvoid}, ())
      nothing
  end
@Leticia-maria Leticia-maria changed the title Correct the __initi__ function to publish a new release Correct the __init__ function to publish a new release Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant