On Mon, Jun 9, 2008 at 6:53 AM, Mark Dewing <[EMAIL PROTECTED]> wrote:
>
> Would it be useful to add a 'format hint' field to the nodes?
> Expressions would remain stored as they are now, but the formatters
> could use the hints to adjust the form of the output.
>
> For example, if a user enters sqrt(2), the hint for the Pow node would
> indicate 'radical'.  If the user enters '2**(1/2)', the hint would
> indicate 'exponentiate'.   The hint could also be changed later to
> alter the output form.
>
> If this is a reasonable approach, there are some other issues to
> consider:
>  1. What is a good way to represent the hints?
>  2. How should hints be handled when nodes are combined, split, or
> otherwise transformed?
>  3. Is adding extra memory usage to the nodes a problem?


That is an interesting idea. How does other CAS systems (e.g.
Maple/Mathematica) handle these?

Wouldn't it be easier to just implement these hints in the printing
routines (or the approach I described in my previous email)? You
raised valid points, I think the best way is to simply go ahead and
try something that you think could do the job and see how it works,
how fast it is, how robust it is etc. If the whole thing can be
implemented in just a couple lines (and it will not slow things down),
let's do it.

Let us know if you need any help with that,

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
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