Hi Martin Baker,

maybe you should fix the line

https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/scene.spad.pamphlet#L478

It's utterly wrong.

As Bill stated at

http://axiom-wiki.newsynthesis.org/AxiomIssues#[email protected]

there are different ways of inheriting method code from from parents.
The category default is more similar to the way inheritance works in traditionall OO languages. But be aware that you will run into trouble because SPAD cannot control which function code to take when you inherit the same function from multiple categories.

Looking at your code, it appears to me that an object oriented style is probably the best fitting paradigm for a scene graph. I still don't like it so much since in your design each node plays basically the same role.

I would have liked to see in the type system, that the SceneRootNode is never allowed below itself. In fact, I believe the other nodes have similar restrictions. You haven't yet encoded that information into the type system. Using an OO style the way I suggested it or Bill's suggestion using a Union, actually loses the information about allowed types. Whether you use Union() or Object(), you basically say that your data is of type "Type" and by this you defeat that SPAD has been created to take care of types.

I know that doesn't help you much. I might be able to help, if I had a clearer picture of what the actual scene tree structure is suposed to look like. List all the restrictions (no code necessary).

Maybe you do it on github in the respective pamphlet. Your current one already starts out from the beginning to design something object oriented. Maybe there is something better. But you are the master in this whole drawing business, I can only help with designing the right types. Sounds like a lot of conversation needed until we have closed all the gaps between us. ;-)

Ralf

--
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.

Reply via email to