On Jun 3, 2009, at 12:11 PM, Jason Grout wrote:

> William Stein wrote:
>> On Wed, Jun 3, 2009 at 11:45 AM, Robert Bradshaw
>> <[email protected]> wrote:
>>> Currently symbolic variables are un-indexable. What would people
>>> think of having indexing create new subscripted variables?
>>>
>>> sage: a = var('a')
>>> sage: a[0]
>>> a_0
>>> sage: latex(a[1,2])
>>> a_{1,2}
>>
>> That's a pretty wild and crazy idea.  Cool.  Does any other math
>> software do that?
>> Are there any obvious gotcha's?
>
> So as far as printing, a[0] would look the same as a0 would look the
> same as a_0?  Would a[0] actually be the variable a_0 or a0?

I'm not sure. My first intent was that a[0] would actually be a0, but  
it's unclear how to format multiple indices (I'd want a[1, 23] != a 
[12, 3]). Also, should we support a[i]? Then I'd want a[i].subs(i=5)  
== a[5]. What about v[5].subs(v=vector(range(10)))?

> Do we ever want to make symbolic expressions indexable?  If so, it  
> would
> be confusing to have:
>
> (x+1)[0]
>
> have totally different behavior than
>
> (x)[0].

They're not now. Having both would be confusing. I'd vote for the  
latter--if (x+1)[0] worked, would it be the same as (1+x)[0], or (x+1- 
x)[0]?

Answering your question about experimental mode, you're talking about  
something easier and more permanent than applying a patch from trac?  
Would people start depending on it, meaning we can't remove it  
without sacrificing backwards compatibility (despite the name  
"experimental")?

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to