Keyword
allbutworks with the part commands (i.e. part, inpart, substpart,
substinpart, dpart, and lpart). For example,
(%i1) expr : e + d + c + b + a; (%o1) e + d + c + b + a (%i2) part (expr, [2, 5]); (%o2) d + a
while
(%i1) expr : e + d + c + b + a; (%o1) e + d + c + b + a (%i2) part (expr, allbut (2, 5)); (%o2) e + c + b
allbut is also recognized by kill.
(%i1) [aa : 11, bb : 22, cc : 33, dd : 44, ee : 55]; (%o1) [11, 22, 33, 44, 55] (%i2) kill (allbut (cc, dd)); (%o0) done (%i1) [aa, bb, cc, dd]; (%o1) [aa, bb, 33, 44]
kill(allbut(a_1, a_2, ...)) has the effect of kill(all)
except that it does not kill the symbols a_1, a_2, ... .