## Force evaluate index expression before passing to sum()

问题 I want to write an (somehow) enhanced sum function which takes a number of indices at once, but I cannot understand how to get it work. Here is what I currently have: (%i1) nsum(indexes, expr) := if indexes = [] then expr else nsum(rest(indexes), sum(expr, first(indexes),1, N)) $ (%i2) nsum([i,j], i+j), nouns; sum: index must be a symbol; found intosym(first(indexes)) #0: nsum(indexes=[k,j],expr=k+j) I think this could be fixed by forcing Maxima expand first(indexes) into a symbol before