From: Stavros M. <mac...@gm...> - 2023-10-24 15:56:16
|
On Tue, Oct 24, 2023 at 3:31 PM Eduardo Ochs <edu...@gm...> wrote: > map sometimes recurses on trees, not on lists: > Not true. Map only works on the top-level arguments of the function: map(f,a+b+c) => f(a)+f(b)+f(c) map(f,a/2+b/2+c/2) => f(a/2)+f(b/2)+f(c/2) map(f,(a+b+c)/2) => f(c+b+a)/f(2) (top level operator is "/") map(f,[[[a],b],c]) => [f([[a],b]),f(c)]. (top level operator is "[") On the other hand, with *listarith=true* (the default), Maxima performs term-wise arithmetic on lists: [a,[b,c]]+[[q,r],s] => [[q+a,r+a],[s+b,s+c]] listarith:false$ [a,[b,c]]+[[q,r],s] => [[q,r],s]+[a,[b,c]] |