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: root
Subject: Re: [Axiom-mail] Data structure for object definition
Date: Thu, 28 Sep 2006 09:02:08 -0400

> | Types created at runtime can also be accessed.
> | 
> | What you'd need to do is define a package which exports a set
> | of functions you'd like which give you the ability you need.
> | Once these functions are defined we can certainly create the
> | lisp functions which implement them.
> 
> So those functions need to be Lisp, instead of SPAD?
> 
> | Your package can then call
> | these lisp functions at the spad level to let you do anything 
> | you'd like.
> 
> OK.
> 
> | What functions do you need and why do you need them?
> 
> I need the functions for implementing Algorithmic Differentiation of
> codes written in SPAD.

Ultimately any reflection mechanism needs to know the details
of the underlying data structures and how information is represented.
How detailed this knowledge needs to be depends on what you want to know.

See FAQ #19 How can I get equations written on one line?
It hay answer some of your questions.

More detailed information requires that you reach into lisp.
Axiom does this all the time. For instance in outform.spad.pamphlet
we see

        (a:$ = b:$):Boolean  == EQUAL(a, b)$Lisp

which means that we define the Spad "=" function to be the lisp EQUAL.
The $Lisp package is always available so you can define any function
you want in lisp and use it in spad.

I'd recomment that you define a spad package that exports all of
the functions you'd like to have to do Algorithmic Differentiation.
We can then work on creating lisp functions that access and format
the underlying lisp data structures so you can implement the spad
level functions. 

No one outside of the Algorithmic Differentiation package will know
that it accesses lisp.

t




reply via email to

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