Menu ▾ ▴

#2319 subst allows nested lists

open
nobody
None
2
2012-11-18
2011-12-07
No

The user documentation for subst doesn't mention that the first argument of subst can be a nested list; for example

(%i25) subst([[a=2]],a+b);
(%o25) b+2

For lists L1 and L2, subst(L1, subst(L2,e)) = subst(append(L1,L2), e) isn't an identity; example:

(%i31) subst([[b=1]], subst([[a=1]], a+b));
(%o31) 2
(%i32) subst(append([[b=1]],[[a=1]]),a+b);
subst: improper argument: [[b=1],[a=1]]

(%i33) subst([b=1], subst([a=1], a+b));
(%o33) 2

(%i34) subst(append([b=1],[a=1]),a+b);
(%o34) 2

Discussion


Log in to post a comment.