On Tuesday 08 Mar 2011 17:08:33 Ralf Hemmecke wrote: > In fact, we all know that mathematical notation is not always precise to > the last bit. Steele shows examples like how to parse: > > 3 x sin x cos 2 x log log x (40:00) > > We should accept that programming languages can help to make things more > precise.
It seems to me that mathematical expressions, and indeed programs, are fundamentally tree structures (or perhaps directed graphs) so the problem comes from notating them as linear sequences of characters. The best way to represent tree structures is XML such as MathML. I therefore think that the only real answer to this is to store 'source code' as a superset of MathML. Of course users would not want to work with a low level editors and have to know about tags and so on. This means that all code editing would be done at a high level using a WYSIWYG MathML editor. You might accuse me of mixing up editing and programming issues but I think I am suggesting the reverse, that is separating the fundamental structure from the notation. So at the centre we have the code base stored as a superset of MathML. On one side of this we have I/O formatters and editors, they know about various types of bracket, whitespace, prefix, infix or postfix notation and so on. On the other side are the compilers, interpreters, they don't need to know about brackets, whitespace, lex analysis, prefix, infix or postfix notation or anything like that, they just read the code in a completely unambiguous way. Code completion and error highlighting tools would also be easier to implement. BTW - For others - its worth watching the video to get a feel for what it might look like programming using a more mathematical style of notation. Martin Baker -- 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.
