From: Davide P. C. <dp...@un...> - 2008-07-09 12:19:28
|
> The PGauxiliaryfunctions.pl and PGcommonFunctions.pl define perl > functions not MathObject functions. Right. > Instructors can use perl functions such as $a = C(15,3) > but $A = Compute("C(15,3)"); will produce an error and students will > not be able to use C(15,3) as part of their answer. Right again. > This all seems like the correct behavior to me. Good. > (I believe this is a minor change from the behavior of fun_cmp before > MathObjects since, to the best of my recollection, > the perl parser for fun_cmp had access to any function defined in a > main:: by PGauxiliaryfunctions.pl ) The current situation is > preferable I just > need to make sure I understand it well enough to document it > accurately. That might be the case, but I don't remember. That would be bad, since main:: contains LOTS of functions. > For the next step: My first impression is that we can add the dozen > or so remaining functions in PGauxiliaryfunctions.pl to > PGcommonFunctions.pl and eliminate or redirect the first file > completely. I think PGcommonFunctions.pl would be the one to remove, as it is not called directly from any problem files, but only from PGauxiliaryFunctions.pl and Parser.pl (or maybe it's Value.pl; I don't remember). Note that the dozen or so other functions are not ones that usually make sense for use in student answers, which is one of the reasons that they are not available in MathObjects. But it would not be a problem if they were moved to PGcommonFunctions.pl either as direct definitions, or as the kind that use CommonFunctions->Call so that they COULD be hooked into MathObjects if desired. > Another task will be to inventory the functions defined > in PGauxiliaryfunctions.pl > (and perhaps PGcommonFunctions.pl) and see which of them should be > added either to the general context or added to specialized > contexts so that the functions can also be used in MathObjects. Many > of them have already been added. All the ones in commonFunctions.pl are in MathObjects contexts. You could list which ones are in which contexts, I guess. The ones in PGauxiliaryFunctions.pl are NOT in any MathObject context. > In both cases the goal would be to make it easy for a new author to > determine > (1) which "special" functions have already been defined somewhere in > the PG files. > (2) which contexts (specialized or general) are needed in order to > allow use of these functions in MathObjects by instructors or > students. Remember that is is always possible to add new functions to a context (and to copy them from one context to another on the fly). Davide |