axiom-mail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Axiom-mail] Data structure for object definition


From: Page, Bill
Subject: RE: [Axiom-mail] Data structure for object definition
Date: Wed, 27 Sep 2006 21:29:23 -0400

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.

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

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. Of course this is just a point of philosophy
and not a comment on the effectiveness of these methods.

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.

Next step is to abuse this information and extend our aldor domain
above to include these operations."

-------

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]