9 May
2017
9 May
'17
5:41 p.m.
Hi Vladimir, yes, I know about the map() function. But that recurses into all sub-expressions, doesn't it? I only want to work on the top-level subexpressions. That is, if the expression is a mul, on its factors, otherwise on the expression itself. I suppose I could pass a level argument to the map function, but that seems like a lot of overhead for a simple problem. Most of the time I apply only a single line of code to my expression. Coding that in a map() function would result in lots more lines of code plus an extra function. The sort of thing I am thinking of is that iteration over an expression would work even if the expression consists e.g. of a single integral. Greetings, Jan