Franco Saliola wrote: >> >> Any comments or objections? > > What about list comprehensions? Something like the following. > > sage: var('i,n') > (i, n) > sage: sum(2^i for i in range(n+1)) > 2^(n+1) - 1 > > I ask because this seems like the natural/first thing a user would try.
It's consistent: sage: sum(i for i in range(10)) 45 However, range would have to also be overridden here, since range only accepts integers. Or we could override the ellipsis notation: sum(i for i in (1..oo)) sum(i for i in (1..n+1)) hmmm, interesting ideas. Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---