Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
Gabriel: Thanks again for all the help. I'll download the OpenAxiom version and try it. William On Tue, 10 Nov 2009 15:25:08 -0600 Gabriel Dos Reis wrote: On Tue, Nov 10, 2009 at 1:37 PM, William Sit wrote: Hi Waldek: Thanks. That is exactly what I want. Good solution. So the "trick"

Re: [Axiom-developer] pointers//Decontructing domains

2009-11-10 Thread Tim Daly
Axiom now has an "API" (ApplicationProgramInterface) domain (similar in spirit to Aldor's Builtin domain). I will add devaluate to it. I will also change the SExpression domain to export the symbol-* functions from lisp with proper conversion functions. Tim William Sit wrote: Tim: Thanks, yo

Re: [Axiom-developer] pointers

2009-11-10 Thread Gabriel Dos Reis
On Tue, Nov 10, 2009 at 1:37 PM, William Sit wrote: > Hi Waldek: > > Thanks. That is exactly what I want. Good solution. So the > "trick" is to use ' instead of the string. So is the > following a bug? In OpenAxiom, you can get the name of a constructor as an Identifier: (7) -> name constructor

Re: [Axiom-developer] pointers

2009-11-10 Thread Gabriel Dos Reis
On Tue, Nov 10, 2009 at 10:45 AM, William Sit wrote: > Gabriel: > > Thanks for the response. Your script shows how to get the parameters, not > the constructor. I do not have OpenAxiom installed (sorry). The question is > whether I can test that the constructor is Fraction, or otherwise (like > Fi

Re: [Axiom-developer] pointers//Decontructing domains

2009-11-10 Thread William Sit
Tim: Thanks, your method works. For me at least, it is much easier to handle strings than SExpression. Waldek also provided a working method using opOf (but that involves SExpression, and the output in SExpression can be misleading), which is perhaps a bug (see my reply to Waldek). To summarize

Re: [Axiom-developer] pointers

2009-11-10 Thread Tim Daly
William, a:='Fraction::SEX is a lisp symbol. A lisp symbol is essentially the address of a data structure which is approximately struct symbol-function (pointer to code) symbol-name (a string representation of the symbol) symbol-package (the lisp package (a hash table poin

Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
Hi Waldek: Thanks. That is exactly what I want. Good solution. So the "trick" is to use ' instead of the string. So is the following a bug? a:='Fraction::SEX Fraction Type:SExpression b:="Fraction"::SEX Fraction Type:SExpression (a=b)@Boolean false Type Boolean That is, I was deceive

Re: [Axiom-developer] pointers

2009-11-10 Thread Waldek Hebisch
William Sit wrote: > Gabriel: > > Thanks for the response. Your script shows how to get the > parameters, not the constructor. I do not have OpenAxiom > installed (sorry). The question is whether I can test that > the constructor is Fraction, or otherwise (like > FiniteField) when the domain b

Re: [Axiom-developer] pointers

2009-11-10 Thread Tim Daly
I'm not sure what you are asking. Are you having trouble with working in the SExpression domain? You can move the SExpressions out to other domains. Sometimes it is painful but it works. So: a:=FiniteField(5,2) b:=devaluate(a) string(SYMBOL_-NAME(b.1)$Lisp) ==> "FiniteField" (of type String) in

Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
It appears that to test the constructor, one must test a candidate against a known one via the constructor itself, and not be "fiat" by using a SExpression. Is this related to hashing of pointers? Continuing with script in the previous email (attached): (11) -> EQ(c.1,d)$Lisp (11) ()

Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
Tim: Sorry about the last message, please ignore. The problem is solved (I was simply not being careful) and made some false claims on the results. (16) -> )clear all All user variables and function definitions have been cleared. (1) -> a:=FiniteField(5,2) (1) FiniteField(5,2)

Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
Gabriel: Thanks for the response. Your script shows how to get the parameters, not the constructor. I do not have OpenAxiom installed (sorry). The question is whether I can test that the constructor is Fraction, or otherwise (like FiniteField) when the domain belongs to the category Field.

Re: [Axiom-developer] pointers

2009-11-10 Thread William Sit
Thanks, Tim. That is exactly what I am looking for. Now I would like to compare c.1 with some known constructor, say Fraction. (In other words, given a domain of category Field, I would like to know if it comes from the constructor Fraction). I tried a few variations and each time, Axiom says: