WeBWorK Main Forum

List of unmaskable PG functions?

List of unmaskable PG functions?

by Michael Shulman -
Number of replies: 0
When writing my own webwork problems, I often define my own Perl subroutines.  I have found recently that there are some function names that are predefined by webwork and apparently cannot be masked by user-defined subroutines.  If I define a subroutine with one of those names, no error message is given, but my subroutine is never actually called; when I try to call it, it seems that the built-in function is called instead.

I find this sort of bug to be unintuitive and hard to track down.  In my ideal world, either user-defined subroutines would mask predefined webwork functions, or it would be an error to define a subroutine with the same name as a predefined function.

But the next best thing would be to have a list of all the predefined functions so I can avoid them in naming my subroutines.  So far, the ones I've found (through accidentally colliding with them) are "gcd", "statement", and "negate".  Is there a list of all these functions somewhere?  I've tried searching the wiki but haven't found it there yet.