axiom-developer
[Top][All Lists]

## Re: [Axiom-developer] pointers

 From: Tim Daly Subject: Re: [Axiom-developer] pointers Date: Mon, 09 Nov 2009 21:24:48 -0500 User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

```I'm not sure what you want. Perhaps you'd like to say:

a:=Fraction(Polynomial(Integer))
b:=devaluate(a)\$Lisp

which returns the list (actually of type SExpression)

(Fraction (Polynomial (Integer)))

c:=destruct(b)
c.2

which returns (Polynomial (Integer))

Does that help?

Tim

William Sit wrote:
```
```Tim:

```
Interesting. Is there a similar function that is more structural? say, can I test whether some domain (which may be passed as a parameter of type Field) is of the form Fraction(something) and if so, extract "something" (that is, assign it to a variable and further test it), sort of a deconstruction?
```
William

On Mon, 09 Nov 2009 19:51:45 -0500
```
```You can get a memory pointer to a lisp object.

a:=Fraction(Integer)

returns the "memory location of Fraction(Integer)"
You can prove this with

b:=Fraction(Integer)
EQ(a,b)\$Lisp

The lisp function EQ compares memory pointers.

There is a lisp function to get the hash value of any object
call sxhash. You can call it.

SXHASH(a)\$Lisp

Note that if

c:=Integer

then
EQ(a,c)\$Lisp is false
SXHASH(a)\$Lisp is not equal to SXHASH(c)\$Lisp

Thus the hash function you seek already exists.
You just have to accept the fact that Spad is only syntactic
sugar for lisp code and lisp is not evil.

Tim

_______________________________________________
Axiom-developer mailing list
http://lists.nongnu.org/mailman/listinfo/axiom-developer
```
```
William Sit, Professor Emeritus
```
Mathematics, City College of New York Office: R6/202C Tel: 212-650-5179
```Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/

```
```

```