Restarting
the webserver is important since the modules are loaded in when a child
process starts up. I think your problem is that you need to call
$a = Chromatic::chn(1);
since chn is defined in the Chromatic namespace.
It's a matter of preference whether you want to make copies of certain calls in
the main:: namespace so that problem writers don't need to worry about such things.
My practice in the early days was to use a macro package such as Chromaticmacros.pl
to define sub chn { Chromatic::chn(@_); }
Where chn was defined in package Chromatic; in file Chromatic.pm.
The subroutine chn is automatically imported into the main namespace by
WeBWorK from the macro pl file. Some of the more
esoteric methods I didn't export and these would be accessed by
something like
Chromatic::foobar(). Davide's parser methods are more likely to refer
to commands within namespaces. As the number of tools available in
WeBWorK continues to grow we may well want to change our practice about
how macros are named.
<| Post or View Comments |>
|