> [ x ] No, I can read the above just fine. It is crystal clear. ... but of course unnecessarily verbose. In my opinion a more common notation in Sage:
sage: x=2*vector(range(10))+vector(10*[3]) sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x))) is superior to Mathematica. On Tue, Jul 14, 2009 at 6:35 PM, William Stein wrote: > > 2009/7/14 Carlos Córdoba <ccordob...@gmail.com>: >> Thanks John, I'd seen Python comprehensions before, but since I was trying >> to do all in a one-liner, I think I overlooked your elegant and simple >> solution. One comprehension at a time is quite neat, but several is just >> unreadable. > > That could be a function of familiarity. Quick poll -- Do you find > the following "just unreadable"? > > x = [1,2,3] > y = [2*a for a in x] > z = [b + 3 for b in y] > w = [a/max(z) for a in z] > v = [[cos(a), sin(a)] for a in w] > > ANSWER: > [ ] Yes, the above is just unreadable. > [ ] No, I can read the above just fine. It is crystal clear. > > > -- William > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---