Ralf and Waldek, Thank you very much for your helpful replies. This gives me lots of options to think about.
If I understand Waldek correctly then, because I am doing the test inside DirectedGraph, I would need an extra domain parameter to pass this information. So instead of creating a second level graph like this: INNER := DirectedGraph(String) P := directedGraph(["a","b","c","d"])$INNER OUTER := DirectedGraph(INNER) ML := directedGraph([P])$OUTER I would have to do it like this: INNER := DirectedGraph(String,nil) P := directedGraph(["a","b","c","d"])$INNER OUTER := DirectedGraph(INNER,String) ML := directedGraph([P])$OUTER As you say, this does get a bit messy. It would probably be easier to have a completely different version of DirectedGraph for second order graphs. I think Ralf s approach would be very useful to generalise the code here, for instance, https://github.com/martinbaker/fricas/blob/master/src/algebra/graph.spad.pamphlet#L2164 Where we are purely testing for a second order graph in order to switch to a simpler output (otherwise second order graphs would generate lots of confusing output on the command line). However, in other cases like this: https://github.com/martinbaker/fricas/blob/master/src/algebra/graph.spad.pamphlet#L1921 After testing that we are in a second order graph we then want to use the inner graph in some way, in this case we 'pretend' to it, so this would be difficult to generalise. I still have not come to a conclusion about the earlier design issues raised by Franz and Waldek. I have tried to document the issues here: https://github.com/martinbaker/fricas/blob/master/src/algebra/graph.spad.pamphlet#L291 I think that, rather than rushing in to add more complex code, I should work on something else for a while while I mull over these options. In the meantime I think the improvements to the code here is worthwhile as it stands: https://github.com/martinbaker/fricas/blob/master/src/algebra/graph.spad.pamphlet https://github.com/martinbaker/fricas/blob/master/src/algebra/scene.spad.pamphlet https://github.com/martinbaker/fricas/blob/master/src/hyper/pages/graphics.ht Thanks, Martin -- 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.
