rljacobson / FoxySheep

Compiler Technologies for Mathematica/Wolfram Language.
BSD 2-Clause "Simplified" License
36 stars 3 forks source link

Handle DirectedArrow and UndirectedArrow #4

Open rocky opened 3 years ago

rocky commented 3 years ago

These more recent additions are used in Rules and Graphs. From https://github.com/Mathics3/mathicsscript/pull/2

I am guessing this was a more recent addition so that's why there aren't in the otherwise meticulously precise FoxySheep?

Correct. In fact, the graph operators are parsed differently in current versions from when they were introduced not that long ago. They used to be non associative so that a [DirectedEdge] b [DirectedEdge] c was a syntax error. Now it's left associative (IIRC) so that the same expression is parsed as DirectedEdge[DirectedEdge[a, b], c].

I complained in the WolframLanguage Slack group that I wanted it to be parsed as Graph[{a > [DirectedEdge] b, b [DirectedEdge] c}], but the author of igraph, Szabolcs Horvát, whose knowledge of Mathematica is unparalleled outside of Wolfram, tells me that mine is the worst possible alternative for graph theory, so who am I to argue?