Martin Rubey wrote:
>
> Martin Rubey <[email protected]> writes:
>
> > I found a bug in unparse:
>
> > I believe the bug is in form2String1, format.boot, where the function
> > SEGMENT is given special treatment:
>
> Well, it's not in form2String1, but rather in application2String. I
> removed both, and now things seem to work fine. I'll do some checking,
> and commit if nobody complains. -- I think in general it's better to
> have unparse output explicit function calls, and rather prefix notation
> than infix.
>
I am not sure what the proposed change is and in particular
what form of output do you get. IMHO the best version would
be:
"(1..3)$Segment(Fraction(Integer))"
that is version with parentheses. The corret prefix form is:
(..$Segment(Fraction(Integer)))(1, 3)
but this looks worse. Also
SEGMENT(1, 3)$Segment(Fraction(Integer))
does not look very good (and is the longest one). In fact, I would
prefer to disable forms like SEGMENT, because they mix user
input with internal representation of compiler parse trees.
Currently users effectively can inject arbitrary (possibly
malformed) subtrees into parse tree. If we switch to better
parser such forms will either stop working or require special
cases in compiler/parser.
SEGMENT is slightly different, because the library name is
used as a way to connect '..' to Segment domain. Still,
I do not like fact that this mixes library names with
tags in parse tree...
To be clear: I write "I do not like" to idicate that this is
not strong opposition -- if the fist way is too hard to do or
other folks really prefer SEGMENT (or '(..$Segment(Fraction(Integer)))')
then I will not object.
--
Waldek Hebisch
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" 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/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---