“”"
register_kinds!(mod, module_id, names)
Register custom Kinds with the given names, belonging to a module mod.
names is an array of arbitrary strings.
In order for kinds to be represented by a small number of bits, some nontrivial
cooperation is required between modules using custom kinds:
- The integer
module_idis globally unique for eachmodwhich will be used
together, and not larger than $_kind_module_id_max. - No two modules register the same
name. The semantics of a givenkindname
should be defined by the module which owns it.
To allow ranges of kinds to be delimited and quickly tested for, some special
names are allowed: BEGIN_section and END_section pairs are detected, and
alias the next and previous kind id’s respectively so that kinds in section
can be tested with BEGIN_section <= k <= END_section.
“”"
function register_kinds!(mod, module_id, names)
_register_kinds!(_kind_modules, _kind_int_to_str, _kind_str_to_int, mod, module_id, names)
end
I’m confused why should other module use this function to register kinds. Isn’t this function private? Shouldn’t kinds be hardcoded in the compiler?