On 11/11/2012 05:25 AM, Burcin Erocal wrote:
> 
> Thanks for pointing this out Jean-Pierre. Here is the ticket:
> 
> http://trac.sagemath.org/sage_trac/ticket/11576
> 
> I don't remember if the patch attached to the ticket is the most recent
> one. This might be better:
> 
> http://sage.math.washington.edu/home/burcin/indexed_expression_20111118.patch
> 
> IIRC, the main outstanding issue was how to handle the conversion of
> these to maxima. At some point I promised to write a function that does
> some name mangling before the maxima calls, but never got to it.
> 
> Perhaps libmaxima can handle these without this hack anyway. In any
> case, we need to revisit the code that converts symbols to maxima and
> back because of #13655. So this might get solved on the way.
> 
> 

...

>>>
>>> If a(1) returned 'a1', it was not preposterous to have a() return
>>> 'a'. But a[] is a syntax error, so to hell with it =) 
> 
> How do these interact with existing symbolic expressions in arithmetic
> or function application?
> 

>From the ticket, it looks like you and Florent have something stronger
in mind than I did. I only need a bunch of symbols that I can access
easily by subscripting.

I started working on a __getitem__ for Expression but got scared by the
ticket I mentioned at the beginning of this thread. So, the new plan was
to have SR.symbols() return an instance of a separate class,
SymbolSequence, that supports indexing.

No mangling is done; the indices are just thrown onto the end of the
sequence name and passed to SR.symbol() if a symbol with that name
doesn't already exist. My most common use case is simple:

  sage: a = SymbolSequence('a')
  sage: p = sum([ a[i]*x^i for i in range(0,5)]); p
  a4*x^4 + a3*x^3 + a2*x^2 + a1*x + a0

where I may want to pass in the degree as a parameter. Slices, tuples,
and combinations thereof also work.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to