From: dpvc v. a. <we...@ma...> - 2009-11-04 18:12:27
|
Log Message: ----------- Avoid unwanted error message in log file about redefining log() function Modified Files: -------------- pg/macros: PGcommonFunctions.pl dangerousMacros.pl Revision Data ------------- Index: dangerousMacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/dangerousMacros.pl,v retrieving revision 1.57 retrieving revision 1.58 diff -Lmacros/dangerousMacros.pl -Lmacros/dangerousMacros.pl -u -r1.57 -r1.58 --- macros/dangerousMacros.pl +++ macros/dangerousMacros.pl @@ -1379,4 +1379,5 @@ sub cos($) {return CORE::cos($_[0])}; sub atan2($$) {return CORE::atan2($_[0],$_[1])}; +sub Parser::defineLog {eval {sub log($) {CommonFunction->Call("log",@_)}}}; 1; Index: PGcommonFunctions.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGcommonFunctions.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -Lmacros/PGcommonFunctions.pl -Lmacros/PGcommonFunctions.pl -u -r1.9 -r1.10 --- macros/PGcommonFunctions.pl +++ macros/PGcommonFunctions.pl @@ -40,7 +40,6 @@ return $self->$fn(@_); } -sub log {CORE::log($_[1])} sub ln {CORE::log($_[1])} sub logten {CORE::log($_[1])/CORE::log(10)} @@ -98,7 +97,8 @@ # which package-specific version to call # -sub log {CommonFunction->Call('log',@_)} +Parser::defineLog(); ## defined in dangerousMacros so warning about redefining log() can be avoided + sub ln {CommonFunction->Call('ln',@_)} sub logten {CommonFunction->Call('logten',@_)} |