I can't understand why this error Error, adding lists of different length show up only when removing a print statement!
Why would a print has anything to do with an error message showing up or not?
some context. I wanted to call map on expression, but wanted to collect the result of operating on each indent in a list as map goes through the expression on term after the other. The expression will be type `+`.
I did not know how to do it inside map. So I create separate proc which map call.
Inside this proc, I use list to append to (this will small list, few terms at most). To be able to do this, I made the list I want to collect thing into a global variable outside the proc. Everything was working OK, until I remove a print statement I had inside the proc for debugging.
I am sure there is a better way to do this all (i.e. collect map output into a list) and I am trying to find better way. But my question is: Why would this error shows up only when I remove a print statement from the last line in the proc?
I also notice when removing the line variable declaration global L now both version work with no error, but get warning Warning, (in f) `L` is implicitly declared local which is why I added declaration global L in first place.
Maple 2021.2 on windows 10
Thanks to everyone for the answers and information I did not know that map does process return value from a proc it calls. Good to know.