"Page, Bill" <[EMAIL PROTECTED]> writes: | On Wednesday, September 27, 2006 6:38 PM Gabriel Dos Reis wrote: | > ... | > Basically I would like functionalities similar to those in | > mkfunc.spad, but that lets me inspect (using SPAD code) | > category, domain, and package definitions as SPAD objects. | > | | In other words: structural reflection. Right? | | Aside: Have I mentioned this article before? | | http://citeseer.ist.psu.edu/106401.html | | "Reflection in logic, functional and object-oriented programming: | a Short Comparative Study" | by François-Nicola Demers, Jacques Malenfant.
I'll have a look at it. | In Proceedings of the IJCAI'95 Workshop on Reflection | and Metalevel Architectures and their Applications in AI, | pages 29-38, August 1995. | | I think it is an excellent survey of the subject. | | ------- | | Anyway, I still am not convinced that use of reflection in a | statically-typed programming language really makes sense. It | seems to me that most of the information that you seek is easily | available in other ways - simply because the language *is* | statically-typed. I would like to do Algoritmic Differentiation of codes written in SPAD. What other ways do you think is better than having the function bodies as objects to manipulate? I don't want to write another SPAD parser if I can use the existing one. | I am concerned that the use of reflection in | this context might promote a coding style that is somewhat | contrary to that envisaged by the language designers: where such | "introspective" information must be made explicit and manifest | in the structure of the program rather than implicit in the | data structures on which it operates. I hate it when it comes to "language designers thought you only need this, and thou shall not need something else". | SPAD is not Java and believe that is a good thing since I have | already seen some remarkably obscure techniques in Java based | on reflection. Please please, let not go there -- I'm not interested in the Java vs. SPAD debate. I have a need for manipulating SPAD codes as objects. (I do the same for C++ -- see "The Pivot" project.) One uses is for Algorithmic Differentiation (the immediate use I would like to achieve). [...] | IN any case, do not forget the initial work done in Aldor and | SPAD on this subject by Peter Broadbery that I am sure I have | mentioned before. I think it is directly related to what you | want to do. See: | | http://wiki.axiom-developer.org/209 | | Peter was involved with the project to integrate Aldor with Axiom | while at IBM so he is/was intimately familiar with this subject. | See especially his reference to 'interop.boot' in | | http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00250.html | | "From memory, and looking at interop.boot, we find that a domain | is a cons pair of two elements. The first is a vector of functions | (eg. $oldAxiomDomainDispatch), and the second is used as an argument | to functions within the vector. | | The functions do the following: | 1) return the name of the domain, as a null terminated string | 2) unknown | 3) lookup an export by hashcode | 4) return the domain's hashcode | 5) unknown (inheritance related). | | | Categories are similar, but have a different vector of functions. Thanks! -- Gaby _______________________________________________ Axiom-mail mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-mail
