[ww-devel] Issuing warning messages in PG

Davor Cubranic cubranic at stat.ubc.ca
Tue Aug 26 15:50:24 EDT 2014


On Aug 26, 2014, at 12:22 PM, Gage, Michael <michael.gage at rochester.edu> wrote:

> In any PG problem you should use WARN_MESSAGE.  In the macro files you may have to 
> use main::WARN_MESSAGE  particularly if you have declared a package name in the file.

This reminds me: is it recommended to wrap custom macros in a package? It hadn’t occurred to me to do it before, but I now I see it’s pretty common in pg/macros.

Is there anything else that I should be on the lookout if declaring a package name in my macro file? For instance, how can I get my subs to still appear in the ‘main’ namespace so they don’t have to be qualified to call them from a problem file? From what I can see in PG, some macro packages (PGCommonFunctions) switch back to main and add subs there, while others (currencyContext.pl) seem to do it with 'main::PG_restricted_eval’.

Davor


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://webwork.maa.org/pipermail/webwork-devel/attachments/20140826/8515df8d/attachment.html>


More information about the webwork-devel mailing list