What do you mean by "code printer"? I suppose suppose that you must mean something more than just producing a string which when parsed and interpreted re-produces the give code? That is what InputForm provides. Which code? Just a function? Or an entire domain written in Spad?
I don't think it makes much sense to write a "Sage code printer" in Spad. Rather Sage needs to be able to process some intermediate representation of a FriCAS expression, for this SExpression is very convenient. That is what InputForm provides. On 28 February 2017 at 05:07, oldk1331 <oldk1...@gmail.com> wrote: > OK, a summarization: > > Currently the InputForm has very limited purposes, while what > we want is some kind of (typed) code printer: I want a Spad code > printer, Martin wants a Sage code printer, etc. We might want > a code printer that prints to other CAS language. > > Currently, both InputForm and OutputForm are represented by > SExpression, they are typeless. The advantege is that you only > need to deal with SEXP. As for typed code printer, there won't > be a centralized "MiddleForm", it has to be done in a case by case > manner. (e.g. write a "toSpad, toSage, toMaxima" function for each > Type you want to support.) > > Then we will have to add ConvertibleTo(SpadForm/SageForm) > to every domain/category we want to support. (Or add them to > SetCategory :-) This is the only way I can think of. > > Is there better/more elegant way to do this (typed code printer)? > > -- > You received this message because you are subscribed to the Google Groups > "FriCAS - computer algebra system" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to fricas-devel+unsubscr...@googlegroups.com. > To post to this group, send email to fricas-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/fricas-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To post to this group, send email to fricas-devel@googlegroups.com. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.