Hot answers tagged map
3
You have already seen that there are a number of ways to skin this cat but I'd like to add some comments of my own.
Other approaches
When possible I prefer to avoid these situations in the first place, instead using something like:
{{1, 2}, {3, 4}, {5, 6}} /. {x_, y_} :> Thread@{x, {y, y^2, y^3}} // Thread
{{{1, 2}, {3, 4}, {5, 6}}, {{1, 4}, {3, ...
3
I'll just aggregrate here the various responses from the comments, plus my own humble thoughts and understanding (which may lack precision or contain mistakes, so feel free to improve or correct):
Be careful about variable naming. (This is assuming that, generally speaking, you have good reason to have global variables spilling out in your program.)
Use ...
Only top voted, non community-wiki answers of a minimum length are eligible
