Maple is not really a programming language, but rather a
program for performing symbolic mathematics, sort of like matlab being for data manipulation. It has a language, like matlab, and you can write loops structures, functions and procedures, etc.
What I want to do above seems very much a formal manipulation to make the expression look
tighter, so I'm not sure if Maple can actually understand such an expression.