{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Out put" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 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 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "Function:" }{TEXT -1 47 " \+ Copy - true copy for modules, procedures, etc." }}{PARA 0 "" 0 "" {TEXT 26 17 "Calling sequence:" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {MPLTEXT 0 21 7 "Copy(x)" }}{PARA 0 "" 0 "" {MPLTEXT 0 21 20 "Copy(x, \+ 'recursive')" }}{PARA 0 "" 0 "" {TEXT 26 11 "Parameters:" }}{PARA 0 " " 0 "" {MPLTEXT 0 21 1 "x" }{TEXT -1 12 " - anything " }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 12 "Description:" }{TEXT -1 0 "" }{TEXT 26 0 "" }}{PARA 15 "" 0 "" {TEXT -1 125 "This procedure produces a duplicat e copy of its argument. The original object or its copy can then be a ltered independently." }}{PARA 15 "" 0 "" {TEXT -1 9 "With the " } {MPLTEXT 0 21 11 "'recursive'" }{TEXT -1 9 " option, " }{MPLTEXT 0 21 4 "Copy" }{TEXT -1 313 " is fully recursive in tables and rtables. T hus if some elements of a table are themselves tables, the result will be a table containing copies of those tables. Without this option, o nly the outer table would be copied, producing a new table with the sa me tables inside as in the original. For large objects, " }{MPLTEXT 0 21 4 "Copy" }{TEXT -1 71 " is faster without this option. This opti on does not apply to modules." }}{PARA 15 "" 0 "" {TEXT -1 324 "Most M aple data structures, e.g. expressions or lists, are unique: Maple kee ps only one copy of them in memory. Therefore there is neither a need for, nor a possibility of, a copy command for them. However, modules , procedures, tables (including arrays) and rtables (including Arrays) are exceptions to this. Maple's own " }{MPLTEXT 0 21 4 "copy" } {TEXT -1 148 " command works for tables (and almost works for rtables) , but there is still a need to copy modules and procedures, as well as for a recursive copy." }}{PARA 15 "" 0 "" {TEXT -1 29 "This function \+ is part of the " }{TEXT 256 23 "Maple Advisor Database." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 9 "Examples:" }}{PARA 0 "" 0 "" {TEXT -1 46 " Copying a procedure (with its remember table)." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "f:= proc(x) x + y end:\nf(1):= 2:\ng:= Copy(f); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gGR6#%\"xG6\"F(E\\s\"\"\"\"\" \"#,&9$F*%\"yGF*F(F(F(" }}}{PARA 0 "" 0 "" {TEXT -1 24 "This includes \+ a copy of " }{MPLTEXT 0 21 1 "f" }{TEXT -1 18 "'s remember table:" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}{PARA 0 "" 0 "" {TEXT -1 101 "However, the tw o remember tables are now separate, and changes to one are not reflect ed in the other." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "f(2):= 3 ; g(3):= 4;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%\"fG6#\"\"#\"\"$" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>-%\"gG6#\"\"$\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "f(2) <> g(2), f(3) <> g(3);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6$0\"\"$,&\"\"#\"\"\"%\"yGF'0,&F$F'F(F'\"\"%" }}}} {PARA 0 "" 0 "" {TEXT -1 17 "Copying a module." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "M:= module() local L; export Put, Get, F;\n \+ Put:= proc(x) L:= x end;\n Get:= proc() L end;\n F:= x -> \+ x + y; F(1):= 2;\nend;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"MG`6%%$P utG%$GetG%\"FGb6#%+thismoduleG6#%\"LG6\"6%F'F(F)F/F/F/F/F/6#F." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "N:= Copy(M);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"NG`6%%$PutG%$GetG%\"FGb6#%+thismoduleG6#%\"LG6 \"6%F'F(F)F/F/F/F/F/6#F." }}}{PARA 0 "" 0 "" {TEXT -1 34 "Check that t he local variables of " }{MPLTEXT 0 21 1 "M" }{TEXT -1 5 " and " } {MPLTEXT 0 21 1 "N" }{TEXT -1 14 " are separate." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 21 "N:-Put(n); M:-Put(m);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"nG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"mG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "N:-Get() <> M:-Get();" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#0%\"nG%\"mG" }}}{PARA 0 "" 0 "" {TEXT -1 63 "The remember table of the exported procedure F has been copied. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "M:-F(1); N:-F(1);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}{PARA 0 "" 0 "" {TEXT -1 35 "These remember tables are se parate." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "M:-F(2):= 3: N:-F (3):= 4:\nM:-F(2) <> N:-F(2), M:-F(3) <> N:-F(3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$0\"\"$,&\"\"#\"\"\"%\"yGF'0,&F$F'F(F'\"\"%" }}}{PARA 0 "" 0 "" {TEXT -1 123 "Copying a table. This version is not recursive, so the entries refer to the same procedure (with the same remember ta ble)." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "T:= table([a = eval (M:-F), b = eval(N:-F)]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"TG-%& TABLEG6#7$/%\"bGR6#%\"xG6\"6$%)operatorG%&arrowGE\\s#\"\"\"\"\"#\"\"$ \"\"%,&9$F3%\"yGF3F.F.F./%\"aGRF,F.F/E\\s#F3F4F4F5F7F.F.F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "T[a](2),T[b](3);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6$\"\"$\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "TC:= Copy(T);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#TCG-%&TABLEG6# 7$/%\"bGR6#%\"xG6\"6$%)operatorG%&arrowGE\\s#\"\"\"\"\"#\"\"$\"\"%,&9$ F3%\"yGF3F.F.F./%\"aGRF,F.F/E\\s#F3F4F4F5F7F.F.F." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 18 "TC[a](2),TC[b](3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$\"\"$\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "TC[a](2):= 5;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-&%#TCG6#%\"aG6# \"\"#\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "TC[a](2)=T[a] (2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/\"\"&F$" }}}{PARA 0 "" 0 "" {TEXT -1 65 "Recursive copy of a table: now the remember tables are di fferent." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "TC:= Copy(T,recu rsive);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#TCG-%&TABLEG6#7$/%\"bGR6 #%\"xG6\"6$%)operatorG%&arrowGE\\s#\"\"\"\"\"#\"\"$\"\"%,&9$F3%\"yGF3F .F.F./%\"aGRF,F.F/E\\s#F3F4F4\"\"&F7F.F.F." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 26 "T[a](2):= 6; TC[a](2):= 7;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-&%\"TG6#%\"aG6#\"\"#\"\"'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-&%#TCG6#%\"aG6#\"\"#\"\"(" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 20 "T[a](2) <> TC[a](2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#0\"\"'\"\"(" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 9 "See also:" } }{PARA 0 "" 0 "" {HYPERLNK 17 "copy" 2 "copy" "" }{TEXT -1 2 ", " } {HYPERLNK 17 "module" 2 "module" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "pr ocedure" 2 "procedure" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "rtable" 2 "r table" "" }}}{SECT 1 {PARA 0 "" 0 "" {TEXT 26 24 "Maple Advisor Databa se " }{TEXT -1 15 "R. Israel, 2001" }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}{PARA 3 "" 0 "" {TEXT -1 0 "" }}}{MARK "25 0 1" 15 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }