Hey Gents,

I was toying with an idea of writing a program (shocker!) and in the design
of said program I wanted to give the ability to other module writers to
extend functionality of the base program.

The main program would live in bin/ as per normal and claim a namespace of
its own.  Call it: SuperDuperProgram

Within this namespace, I would ideally designate SuperDuperProgram::Modules
to be the namespace that modules would live under.  These modules would
have their own git repos and depend on SuperDuperProgram being installed.

Given this, I'd like the main program to perform a prefix search of
installed modules with that namespace as a prefix, load said modules it
finds, perform callbacks that I would designate as being required to
successfully load the module, etc.

I've read various resources which include the zef source code, the raku
docs, etc., yet am still unable to wrap my head around this.

Any pointers in the right direction as welcomed.

A mock up of what I had in mind:

./bin/SuperDuperProgram
###############################
#!/usr/bin/env raku

my @modules_with_prefix =
search_installed_modules_with_prefix('SuperDuperProgram::Modules');

for @modules_with_prefix {
  # require module
  # perform init callbacks - new() for example
  # whatever else
}

-- 
__________________

:(){ :|:& };:

Reply via email to