I believe, there is a bug in 'evalc'
. The routine don’t work, if the expression contains
unevaluated function calls with indexed names.
> restart; kernelopts(version); interface (version); interface (patchlevel); libname; Maple V, Release 4, IBM RISC UNIX, Nov 20, 1996, RS2-54CD-328813-7 Maple Worksheet Interface, Release 4, IBM RISC UNIX, Nov 25, 1996 2 /usr/local/maple4/update, /usr/local/maple4/lib > `evalc/b` := proc() # to test the user interface of evalc RETURN( u(t)+I*v(t) ); end: > for w in [ I*( a +I*b ) , I*( a(t) +I*b(t) ) , I*( a[1] +I*b[1] ) , I*( a[1](t)+I*b[1](t) ) ] do 'evalc'(w) = evalc( w); od; evalc(I*(a+I*b)) = I*a-b evalc(I*(a(t)+I*b(t))) = -u(t)+I*(a(t)-v(t)) evalc(I*(a[1]+I*b[1])) = I*a[1]-b[1] evalc(I*(a[1](t)+I*b[1](t))) = I*(a[1](t)+I*b[1](t))
The last expression with an indexed name of an unevaluated function call is not expanded.
If the source of the routine ‘evalc/evalc‘ near the line 13 (get with list of the debugger) is changed from
elif type(z,'function') then ..... to elif type(z, 'function') then g := op(0, z); if type(g, name ) then f := `if`( type(g, 'indexed'), op(0,g), g ); f := `evalc/`.f; if not type(f, 'procedure') then traperror(readlib(f)) fi; if type(f, 'procedure') then w := (`evalc/`.g)(op(z)) else ......
than the result is full evaluated:
> for w in [ I*( a +I*b ) , I*( a(t) +I*b(t) ) , I*( a[1] +I*b[1] ) , I*( a[1](t)+I*b[1](t) ) ] do 'evalc'(w) = evalc( w); od; evalc(I*(a+I*b)) = I*a-b evalc(I*(a(t)+I*b(t))) = -u(t)+I*(a(t)-v(t)) evalc(I*(a[1]+I*b[1])) = I*a[1]-b[1] evalc(I*(a[1](t)+I*b[1](t))) = -u(t)+I*(a[1](t)-v(t))
but I am not sure, that this is a correct correction.
It is corrected with Maple 7. (U. Klein)