[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-28 Thread William Stein
On Wed, Mar 5, 2008 at 7:13 PM, Carl Witty [EMAIL PROTECTED] wrote: On Mar 5, 12:07 pm, William Stein [EMAIL PROTECTED] wrote: On Wed, Mar 5, 2008 at 11:45 AM, Carl Witty [EMAIL PROTECTED] wrote: 2) Modify sage_eval so that it can process a sequence of statements followed by an

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-28 Thread Carl Witty
On Mar 27, 11:13 pm, William Stein [EMAIL PROTECTED] wrote: I think it's worth rethiking our _foo_init_ methods a little and allowing a tiny bit more than a single string that has to eval to the object. However, it's critical that we don't do something that is at all complicated or nicely

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-28 Thread Nick Alexander
Here's a nicely overengineered rough proposal. I didn't comment before, but... In my opinion this is not over-engineered. This is the canonical way to do this sort of thing. whole-heartedly support this style and wish it was in place in other areas, such as the production of latex

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-28 Thread Carl Witty
On Mar 5, 7:13 pm, Carl Witty [EMAIL PROTECTED] wrote: Here's a nicely overengineered rough proposal. The idea is to make it easy to write _sage_init_ methods, and get very nice output; without worrying much about how hard it is to write the framework. (I would probably write the framework,

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-05 Thread David Roe
I agree with the choice of _sage_init_. By default this can return self._repr_(), but should be overridden in cases like matrix. David On Wed, Mar 5, 2008 at 1:32 AM, Robert Bradshaw [EMAIL PROTECTED] wrote: _sage_init_ sounds like the right solution. The problem is that for many objects,

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-05 Thread Carl Witty
On Mar 4, 10:59 am, Jason Grout [EMAIL PROTECTED] wrote: This morning I tried to copy a matrix output, edit it, and create a new matrix. It was frustrating because there seemed to be no way to easily cut and paste output into input. This afternoon a person I was showing Sage to also had the

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-05 Thread William Stein
On Wed, Mar 5, 2008 at 11:45 AM, Carl Witty [EMAIL PROTECTED] wrote: On Mar 4, 10:59 am, Jason Grout [EMAIL PROTECTED] wrote: This morning I tried to copy a matrix output, edit it, and create a new matrix. It was frustrating because there seemed to be no way to easily cut and paste

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-05 Thread John Cremona
I like option 2 too. As a single string that example could be R1 = GF(17); R2 = R1['x,y']; x, y = R2.gens(); 3*x^2*y^3 ? John On 05/03/2008, Carl Witty [EMAIL PROTECTED] wrote: On Mar 4, 10:59 am, Jason Grout [EMAIL PROTECTED] wrote: This morning I tried to copy a matrix output, edit

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-04 Thread Mike Hansen
Here's the relevant ticket: http://sagetrac.org/sage_trac/ticket/2387 --Mike On Tue, Mar 4, 2008 at 9:44 PM, Nick Alexander [EMAIL PROTECTED] wrote: This is not general, but if M is your matrix, the code 'matrix(R, m, n, list(M))' is pretty easy. Nick On 4-Mar-08, at 10:59 AM,

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-04 Thread Nick Alexander
This is not general, but if M is your matrix, the code 'matrix(R, m, n, list(M))' is pretty easy. Nick On 4-Mar-08, at 10:59 AM, Jason Grout wrote: This morning I tried to copy a matrix output, edit it, and create a new matrix. It was frustrating because there seemed to be no way to

[sage-devel] Re: repr or input_form or some way of getting the code to create an object

2008-03-04 Thread Robert Bradshaw
_sage_init_ sounds like the right solution. The problem is that for many objects, printing all the information that would make them reproducible is really ugly. For example, if I have [1 2] [3 4] Is this over the integers, or the rationals, or the integers mod 17? Or perhaps it's a