On Fri, Oct 3, 2008 at 4:12 PM, Waldek Hebisch wrote: > > Bill Page wrote: >> On Fri, Oct 3, 2008 at 11:12 AM, Waldek Hebisch wrote: >> > Bill Page wrote: >> >> >> >> Would doing something like this: >> >> >> >> (algebraicNumber (** 2 (/ 1 2))) >> >> >> >> be better? >> > >> > What is type of argument to this hypothetical function? >> >> algebraicNumber:Expression Integer -> AlgebraicNumber > > You mean: > > algebraicNumber(x: Expression Integer): AlgebraicNumber ==
Yes, that is exactly what I wrote. > x::AlgebraicNumber but what appears to the left of == is a different question. > From FriCAS/Axiom point of view such a function is just useless > overhead. > ?? Do you have another *simple* way to obtain values of this domain? > Of course, such function is useful when interfacing to other > systems, but I am afraid this is not the way to go. Basically, it > sounds like "To speak with us you must be exactly like us" -- > the whole idea of inteface is that systems do not need intrusive > changes. > No, this is absolutely not what I mean! The goal is to have a uniform general way to obtain values of domains - for whatever purpose. Interfacing with other systems is just one motivation for this. But in most cases this still would not mean being exactly like them. I do not understand how you reach that conclusion. >> >> if Rep has CoercibleTo(InputForm) then >> coerce(x:%) :InputForm == >> convert(['myDomain,coerce(rep x)@InputForm]) >> myDomain(x:Rep):% == per x >> > One of the main principle of Axiom is that Rep is not visible outside > -- you can change Rep at will and everything will continue to work. > So the above may be useful when handling many specific domains > but definitely can not be taken as "general principle". > In what sense does my proposed code violate information hiding? Rep is not exposed. Under this proposal if you change Rep only the InputForm will change but there are no types in InputForm - only function calls. >> ... >> > But for algebraic numbers we need much more complicated >> > construction: in general we need to specify tower of algebraic >> > extensions. >> >> I don't think so. The same general construction can be applied >> as above. The Rep of AlgebraicNumber is Expression(Integer). >> > > _Currently_ Rep of AlgebraicNumber is Expression(Integer). There > are good reasons to change this. In particular, once we have > AlgebraicNumber in hand we should be able to do reliable zero > testing. > Certainly. As I see it nothing that I am proposing would prevent this. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en -~----------~----~----~----~------~----~------~--~---
