|
From: | William Sit |
Subject: | Re: [Axiom-developer] pointers |
Date: | Tue, 10 Nov 2009 11:38:25 -0500 |
Although Fraction is the name of a constructor, a full type must be specified in the context you have used it. Issue )show Fraction for more information.
Things I tried: a:=FiniteField(5,2) b:=devaluate(a)$Lisp c:=destruct(b) c.1 d:="Fraction"::SExpression e:Boolean e:=EQ(c.1,d) -- message above e:=(c.1=Fraction) -- message above e:= (c.1=d$Lisp) -- message above a1:=Fraction Integer b1:=devaluate(a1)$Lisp c1:=destruct(b1) e:=(c.1=c1.1) -- message aboveI confess that I'm still using a very old Window version (Version of Tuesday November 30, 2004 at 21:11:14) but I don't think that makes a difference in these examples.
William On Mon, 09 Nov 2009 21:24:48 -0500 Tim Daly <address@hidden> wrote:
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 Tim Daly <address@hidden> wrote: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 objectcall 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 syntacticsugar for lisp code and lisp is not evil. Tim _______________________________________________ Axiom-developer mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/axiom-developerWilliam Sit, Professor EmeritusMathematics, City College of New York Office: R6/202C Tel: 212-650-5179Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/
William Sit, Professor EmeritusMathematics, City College of New York Office: R6/202C Tel: 212-650-5179
Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/
[Prev in Thread] | Current Thread | [Next in Thread] |