On Sat, Apr 30, 2011 at 3:16 PM, Aaron S. Meurer <[email protected]> wrote:
>
> On Apr 30, 2011, at 4:03 PM, Ondrej Certik wrote:
>
>> On Fri, Apr 29, 2011 at 8:37 PM, Brian Granger <[email protected]> wrote:
>>>> I am not sure I understand what your idea is, but it seems that's
>>>> exactly how I implemented it? TableForm is an object (it's not an
>>>> issue for me whether or not it is derived from Basic, currently it is
>>>> from technical reasons, but this can be changed), and then I have
>>>> enhanced the printers to be able to print TableForm nicely in all our
>>>> output printers. Because I want to use it with ascii (in terminal), in
>>>> latex (when I write articles, it would be so much easier to just
>>>> create the table in sympy, instead of wrestling with latex by hand),
>>>> html, and so on.
>>>>
>>>> Is there a better design for such a thing?
>>>
>>> In Mathematica, TableForm is not itself a data structure, but only
>>> something that takes a data structure and prints it in different
>>
>> Here is the definition:
>>
>> http://reference.wolfram.com/mathematica/ref/TableForm.html
>>
>> So the way I understand is, that it *is* a data structure, that holds
>> the data, and that can be printed in many formats, but maybe I am
>> wrong. In any case, I want to be able to do all of their examples.
>
> Well, just because Mathematica does it this way, doesn't mean we have to also 
> :)
>
> To me, the data structures and the printers should be separate, because that 
> allows for the best modularity. So the underlying data structure should be 
> some kind of two dimensional array, which then has printers, which can print 
> using ascii, or rst, or latex, or whatever.

Yes, what I am trying to say, that I *do* want to be able to do their
examples, in particular, something (equivalent) to:

TableForm(data, options)

whether internally it's just a function call, or anything else, I
don't mind either implementation. So in order to move forward, I just
did an implementation that works, and now we can improve it.

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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/sympy?hl=en.

Reply via email to