{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE " " 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 }{CSTYLE "Help Heading" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Hea ding 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 8 "Warning:" }{TEXT -1 25 " n ew definition for ... \n" }}{PARA 0 "" 0 "" {TEXT -1 33 "This warning \+ occurs when you use " }{MPLTEXT 0 21 4 "with" }{TEXT -1 306 " to load \+ a package, and the package includes a new definition for a name that p reviously had a different value (which might be from the standard libr ary, from another package, or defined by the user). The new definitio n replaces the old definition (even though the names are protected). \+ For example, the " }{MPLTEXT 0 21 6 "linalg" }{TEXT -1 34 " package co ntains definitions for " }{MPLTEXT 0 21 4 "norm" }{TEXT -1 5 " and " } {MPLTEXT 0 21 5 "trace" }{TEXT -1 56 ", replacing standard library fun ctions with those names." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 435 "These warnings can normally be ignored, except of course if you want to use the old definitions that have been replaced , or if you want to use a procedure whose definition includes a refere nce to them. Note that in Maple, names in a procedure body are evalua ted when the procedure is invoked, not when it is defined, so the curr ent definition is always used. Thus nothing that depends on the old p rocedure is likely to work any more." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 260 "In order to use the old definitions wh en the new package is loaded, you may be able to access them under ano ther name. They should be assigned to other names before loading the \+ new package. In the case of a function that refers to the old names, \+ you can use " }{MPLTEXT 0 21 4 "subs" }{TEXT -1 482 " to replace refer ences to the old name by references to the new name. However, this ca n be complicated because in many cases there may be several levels of \+ procedure calls before the actual call to the procedure in question.\n \nAn alternative, if you only need a few of the procedures in the pack age, is to avoid loading the whole package. Either load a few procedu res that do not conflict with these names, or access the procedures in the long form using the name of the package. " }}}{SECT 0 {PARA 3 " " 0 "" {TEXT 26 9 "Examples:" }}{PARA 0 "" 0 "" {TEXT -1 4 "The " } {MPLTEXT 0 21 4 "norm" }{TEXT -1 70 " function in the standard library calculates the norm of a polynomial." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "norm(1+x^2,2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*$ \"\"##\"\"\"F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(lina lg):" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, new definition for norm " }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for trace" }} }{PARA 0 "" 0 "" {TEXT -1 35 "The standard library definition of " } {MPLTEXT 0 21 4 "norm" }{TEXT -1 50 " is now replaced by the linear al gebra definition." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "norm(1+ x^2,2);" }}{PARA 8 "" 1 "" {TEXT -1 45 "Error, (in norm) expecting a m atrix or vector" }}}{PARA 0 "" 0 "" {TEXT -1 114 "We could have saved \+ the standard library definition under a new name before loading the pa ckage. Note the use of " }{MPLTEXT 0 21 4 "eval" }{TEXT -1 44 ", beca use we want to save the definition of " }{MPLTEXT 0 21 4 "norm" } {TEXT -1 28 " rather than the name. The " }{MPLTEXT 0 21 7 "restart" }{TEXT -1 85 " is needed because once the package is loaded, the origi nal definition has been lost." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "restart;\npolynorm:= eval(norm);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%)polynormG:6%%\"pG%\"nG%\"vG6#%\"cG6#%aoCopyright~(c)~1992~by~ the~University~of~Waterloo.~All~rights~reserved.G6\"C$>8$-%*traperrorG 6#-%'coeffsG6$9$&9\"6#;\"\"$9#@-/F1%*lasterrorG-%&ERRORG6#% " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, new definition for norm" }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for \+ trace" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "polynorm(1+x^2,2); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*$\"\"##\"\"\"F$" }}}{PARA 0 "" 0 "" {TEXT -1 41 "If we want to use a procedure that calls " }{MPLTEXT 0 21 4 "norm" }{TEXT -1 113 " (expecting the standard library version \+ rather than the linear algebra one), we can change to the new name wit h " }{MPLTEXT 0 21 4 "subs" }{TEXT -1 25 ". Again note the use of " } {MPLTEXT 0 21 4 "eval" }{TEXT -1 26 " to obtain the definition." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "norm2:= p -> norm(p,2);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%&norm2G:6#%\"pG6\"6$%)operatorG%&arr owGF(-%%normG6$9$\"\"#F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "newnorm2:= subs(norm=polynorm, eval(norm2));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%)newnorm2G:6#%\"pG6\"6$%)operatorG%&arrowGF(-%)polyno rmG6$9$\"\"#F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 187 "The simpler alterna tive would be to only load selected procedures from the package, not i ncluding the ones that conflict with other names, and refer to those t hat do using the long form. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "restart;\nwith(linalg, matrix, vector): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "norm(1+x^2,2);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#*$\"\"##\"\"\"F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "linal g[norm](vector([1,2]));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}} {SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also:" }{TEXT -1 1 " " } {HYPERLNK 17 "eval" 2 "eval" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "subs" 2 "subs" "" }{TEXT -1 2 ", " }{TEXT -1 0 "" }{HYPERLNK 17 "with" 2 "wi th" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "linalg" 2 "linalg" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 22 "Maple Advisor Database" }{TEXT -1 18 " \+ R. Israel, 1997" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "0" 0 } {VIEWOPTS 1 1 0 1 1 1803 }