On Wed, Aug 26, 2009 at 03:47:05PM -0700, William Stein wrote: > On Wed, Aug 26, 2009 at 2:39 PM, Jason Grout<jason-s...@creativetrax.com> > wrote: > > I should mention that at various times, people have proposed that you > > could create symbolic variables x[1], x[2], etc. As far as I know, > > these proposals have just been ideas and have never been implemented or > > experimented with. > > > > Maybe we could make x[1] a symbolic variable automatically. We would > > have to make an indexing function for symbolic variables that would > > return a symbolic variable that would be cached somewhere (so that x[1] > > always referred to the same variable). That would also give us nested > > indices, as x[1][1] would take a symbolic variable x, create a new one > > x[1], and then x[1] would create another symbolic variable x[1][1]. > > That sounds pretty easy to implement by defining __getitem__ for > symbolic variables, and making it cache its answer using a dictionary.
+1 > Should one only allow x[integer] or more generally x[anything > hashable]? +1 on anything hashable. We (= the *-combinat people) often need to create systems of equations with indeterminates indexed by various combinatorial objects (trees, tableaux, permutations, ...). And in MuPAD we struggled all too often because the various solvers did not support well such variables. Cheers, Nicolas -- Nicolas M. Thiéry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---