[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Chris Chiasson
On Sep 18, 2:10 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote: > How about providing a sum function that would behave like, say, the > integrate function. It could detect the argument types so if you > passed it a list, it'd behave the same as the builtin sum function. > > sage: integrate(x, x, 0,

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread didier deshommes
BTW, matlab has 1-based indexing too. Maple has both: there is an array object that can be 0,1,2,... based and a List object that is 1-based. I think it would be nice to have an iterator object similar to (1:n) in matlab (but not a list object). didier 2007/9/18, Joel B. Mohler <[EMAIL PROTECTED

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Joel B. Mohler
On Tuesday 18 September 2007 14:34, Robert Bradshaw wrote: > I still like the [a..b] notation that makes > things totally obvious, and I am as surprised as Peter Doyle at the > shift of topic of whether or not indices should be 0-based (which we > don't have a choice about while sticking wi

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Mike Hansen
How about providing a sum function that would behave like, say, the integrate function. It could detect the argument types so if you passed it a list, it'd behave the same as the builtin sum function. sage: integrate(x, x, 0, 10) 50 sage: sum(x, x, 0, 10) 55 sage: sum(range(10)) 45 I'm having t

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Robert Bradshaw
On Sep 18, 2007, at 11:22 AM, Jaap Spies wrote: > William Stein wrote: >> -- Forwarded message -- >> From: Peter Doyle (a Professor at Dartmouth) >> Date: Sep 18, 2007 10:32 AM >> Subject: Re: Calculus >> To: William Stein <[EMAIL PROTECTED]> >> >> Hi William, >> >>> There was a

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Jaap Spies
Robert Bradshaw wrote: >> Why not define a new function srange (short for sagerange), >> or redefine the existing srange function: >> >> def srange(a,b=None,step=1, include_endpoint=True): >> >> or something like that. >> >> See sage: srange?? >> >> Alternative: reuse xrange >> this function will

[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread Jaap Spies
William Stein wrote: > -- Forwarded message -- > From: Peter Doyle (a Professor at Dartmouth) > Date: Sep 18, 2007 10:32 AM > Subject: Re: Calculus > To: William Stein <[EMAIL PROTECTED]> > > Hi William, > >> There was a long thread on sage-devel about this: >> >> > http://group