On Thu, Jul 5, 2018 at 11:17 AM, 'Martin R' via FriCAS - computer algebra system <fricas-devel@googlegroups.com> wrote: > > Would it be possible to change that to something like the following > (WARNING: only lightly tested!).
+1 > Two comments: > > 1) The scripts are of type OutputForm, but there is no way to get an > InputForm from an OutputForm. So the below will not work always, but only > when the input is reasonable. In fact > interpret convert subscript('s, [z^2]) works... > > 2) There seems to be a problem when the subscript has a value. For example, > x := subscript('s, ['x^2]) produces an error about cons'ing InputForm with > InputForm. Not sure what's happening there. > > Best wishes, > > Martin > > Code: > > convert(s: Symbol): InputForm == > not scripted? s => convert(name s)$InputForm > > ls := scripts s > A: List InputForm := [e pretend InputForm for e in ls.sub] > B: List InputForm := [e pretend InputForm for e in ls.sup] > C: List InputForm := [e pretend InputForm for e in ls.presup] > D: List InputForm := [e pretend InputForm for e in ls.presub] > E: List InputForm := [e pretend InputForm for e in ls.args] > a: InputForm := convert('script) > b: InputForm := convert name s > c: InputForm := cons(convert('construct), [cons(convert('construct), e) > for e in [A, B, C, D, E]]) > convert([a, b, c]) > > -- I think this is a very good idea. -- 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.