04.05.2013 01:17:34 [->] smath_diff(smath_diff(x,1^3+x,2^3,x,2),x,1) 04.05.2013 01:17:34 [->] D:\tmp\tmpC98C.tmp: interface(quiet=true); with(linalg):with(inttrans): writeto("D:\\tmp\\tmpC98D.tmp"): smath_line := proc() local i: for i from 1 to nargs - 2 do args[i]; od: end: smath_int := proc() if nargs = 2 then int( args[1], args[2] ); elif nargs = 4 then int( args[1], args[2] = args[3] .. args[4] ); fi: end: smath_diff := proc() if nargs = 2 then diff( args[1], args[2] ); elif nargs = 3 then diff( args[1], args[2] $ args[3] ); fi: end: smath_sys := proc() { args[i] $ i = 1 .. nargs - 2 }; end: smath_el := proc() args[1][ args[2] ]; end: smath_mat := proc() local i, j, out: out := [ args[j] $ j = 1 .. args[ nargs ] ]: for i from 2 to args[ nargs - 1 ] do out := out, [ args[j] $ j = ( i - 1 ) * args[ nargs ] + 1 .. ( i - 1 ) * args[ nargs ] + args[ nargs ] ]: od: convert( [ out ], array ); end: smath_submatrix := proc() submatrix( args[1], args[2] .. args[3], args[4] .. args[5] ); end: ans := \ smath_diff(smath_diff(x,1^3+x,2^3,x,2),x,1): if ( whattype( ans ) = `exprseq` ) then convert( convert( cat( `mat(`, substring( convert( [ans], string ), 2..-2 ), `,`, nops( [ans] ), `,1)` ), string ), symbol ); elif ( whattype( ans ) = `set` ) then convert( convert( cat(`mat(`,substring(convert(map2(op,2,[ans[i]$i=1..nops(ans)]),string),2..-2),`,`,nops(ans),`,1)`), string ), symbol ); elif ( whattype( ans ) = `symbol` ) then convert( convert( eval( ans ), string ), symbol ); elif ( whattype( ans ) = `series` ) then convert( convert( ans, polynom) , symbol ); elif ( whattype( ans ) = `string` ) then convert( ans, symbol ); else convert( convert( ans, string ), symbol ); fi; quit: 04.05.2013 01:17:34 [<-] D:\tmp\tmpC98D.tmp: Error, (in smath_diff) wrong number (or type) of parameters in function diff ans