From: Davide P.C. <dp...@un...> - 2005-07-05 12:02:31
|
> I've made a chart of most of the macros currently available for use in > WeBWorK problem (this includes macros from union_problib/macros, but > not > yet the macros from nau_problib/macros) This looks like a good start, and a useful thing, though it is going to be a pain to maintain. I wonder if we should institute some kind of coding convention to help automatically separate the internal routines from the public ones. (Or do you envision maintaining this by hand from now on?) I'm not quite sure I think the last column is necessary, as it is usually incomplete. > There are over 900 macros -- way too many -- so some consolidation is > in order and the place to start would be to try to get a handle on > what has already been produced and how they overlap. In addition to the suggestions that you recommend concerning the older anser macros, quite a few of the parser-based routines are internal and shouldn't be listed. For example, pretty much everything in context*.pl is internal. You might even consider not including any of the parser stuff here, as that is a whole other ball of wax, and only a portion of its routines are in .pl files. This brings up the point that there are many important macros that are part of the .pm files in pg/lib rather than .pl files in pg/macros. The various list macros come to mind, and so on. Should they be included here? Also, some of the routines listed are part of packages and can't be called directly. They either are object methods, or require package names (package::routine). > One of my desires is to replace the calls such as > > strict_num_cmp( $ans, .001,'%0.5f') > by > num_cmp($ans, relTol=>.001, format=>'%0.5f', mode=>'strict') > > and > > strict_num_cmp_list(.001, '%0.5f',$ans1, $ans2, $ans3); > > by > > num_cmp([$ans1, $ans2, $ans3], relTol=>.001, mode=>'strict', > format=>'%o.5f'); > > perhaps a dozen different subroutines can be replaced by using num_cmp > with either a single answer, or a reference to an array of answers and > then > followed by a list of parameters. This is admirable, but I'm not holding my breath to see people convert their old problems or stop using the older forms in new ones. If you do actually remove them from PGanswermacros.pl, that will break lots of existing problems, and while that will force them to update (or at least to add PGcompatibility.pl to those files), it will also be a big aggravation to them. The huge number of different forms of these macros is a pain, though, so I understand the desire to eliminate some of them. It would not be too hard to write a script that does that conversion, I would expect. That would help people out. Davide |