Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Bill Page
Gaby, Thank you for this work. The error message reminds me of a wish: I would really like it if the compiler could pretty print the code that it displays. Reading the lisp notation is still awkward for me years later and I know that it puts off some potential new users. Even if de-compiling > (

Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Gabriel Dos Reis
Bill Page writes: | On Mon, Oct 24, 2011 at 7:36 PM, Gabriel Dos Reis wrote: | > ... | > Bill Page writes: | > | So it is a coincidence that the compiler happens to choose 0@P or that | > | the representation of all of these candidates is the same so that it | > | does not matter? | > | > It is m

Re: [open-axiom-devel] [fricas-devel] Re: constants and overload resolution

2011-10-24 Thread Bill Page
On Mon, Oct 24, 2011 at 7:36 PM, Gabriel Dos Reis wrote: > ... > Bill Page writes: > | So it is a coincidence that the compiler happens to choose 0@P or that > | the representation of all of these candidates is the same so that it > | does not matter? > > It is mostly concidence.  The explanation i

Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Gabriel Dos Reis
Bill Page writes: | On Mon, Oct 24, 2011 at 6:49 PM, Gabriel Dos Reis wrote: | > ... | > Another example:  Consider the function leftLcm from | > NonCommutativeOperatorDivision(P,F)  where | >      P: MonogenicLinearOperator(F) | >      F: Field | > | > the function definition is: | > | >        

Re: [open-axiom-devel] [fricas-devel] Re: constants and overload resolution

2011-10-24 Thread Bill Page
On Mon, Oct 24, 2011 at 6:49 PM, Gabriel Dos Reis wrote: > ... > Another example:  Consider the function leftLcm from > NonCommutativeOperatorDivision(P,F)  where >      P: MonogenicLinearOperator(F) >      F: Field > > the function definition is: > >        leftLcm(a,b) == >            a = 0 =>b >

Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Gabriel Dos Reis
Gabriel Dos Reis writes: | The algebra is full of examples where things work by a sheer amount of | luck. Consider the function rightPower in functor MonadWithUnit: | | rightPower(a: %,n: NonNegativeInteger) == | zero? n => 1 | res := 1 | for i in 1..n repeat res :=

Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Gabriel Dos Reis
Bill Page writes: | Doesn't the compiler already know that the value of res is returned | from the function? No. At the point where the compiler is processing the local assignment        res := 1 it has no clue that it will be used later as the retuned value. | Therefore infers that res

Re: [open-axiom-devel] constants and overload resolution

2011-10-24 Thread Bill Page
Doesn't the compiler already know that the value of res is returned from the function? Therefore infers that res must be of type % ? Even in zero? n => 1 you have the question of what is type of 1. On Mon, Oct 24, 2011 at 6:22 PM, Gabriel Dos Reis wrote: > > The algebra is full of examples whe

[open-axiom-devel] constants and overload resolution

2011-10-24 Thread Gabriel Dos Reis
The algebra is full of examples where things work by a sheer amount of luck. Consider the function rightPower in functor MonadWithUnit: rightPower(a: %,n: NonNegativeInteger) == zero? n => 1 res := 1 for i in 1..n repeat res := res * a res What should be the

Re: [open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Waldek Hebisch writes: | I wrote: | > | > Gabriel Dos Reis wrote: | > > | > > Waldek Hebisch writes: | | > > | | > > | new : (NonNegativeInteger, S) -> % | > > | | > > | So the first argument to 'new' must be 'NonNegativeInteger' and the | > > | second must be '%'. | > > | > > 1. ne

Re: [open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Waldek Hebisch writes: | Gabriel Dos Reis wrote: | > | > Waldek Hebisch writes: | > | > | Gabriel Dos Reis | > | > | > | > | > | > Consider the definition of ModMonoid: | > | > --8<---8<8<-- | > | > )abbrev domain MODMON ModMonic | > |

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Waldek Hebisch
I wrote: > > Gabriel Dos Reis wrote: > > > > Waldek Hebisch writes: > > | > > | new : (NonNegativeInteger, S) -> % > > | > > | So the first argument to 'new' must be 'NonNegativeInteger' and the > > | second must be '%'. > > > > 1. new, expects its second *argument* to be of type %.

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Waldek Hebisch
Bill Page wrote: > > On Mon, Oct 24, 2011 at 1:02 PM, Gabriel Dos Reis wrote: > > > > There is nothing reasonable about it. =A0The way that most AXIOM compilers > > do overload resolution (even in faces of ambiguity) is to pick the first > > from a list that makes the compilation works, regardless

Re: [open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
"Prof. Dr. Johannes Grabmeier" writes: | thanks for the honor - or not: I am not the author of this domain. | OK, I will unregister the voodoo ownership. (but it was meant as honor :-) | It is a "mutable domain" | | )bo PUSH('ModMonic, $mutableDomains) Yes, but that is a different matter fr

Re: [open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Bill Page writes: | On Mon, Oct 24, 2011 at 1:02 PM, Gabriel Dos Reis wrote: | > ... | > Waldek Hebisch writes: | > | I would not call this voodoo: the compiler performs reasonable type | > | inference. | > | > There is nothing reasonable about it.  The way that most AXIOM compilers | > do overlo

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Waldek Hebisch
Gabriel Dos Reis wrote: > > Waldek Hebisch writes: > > | Gabriel Dos Reis > | > > | > > | > Consider the definition of ModMonoid: > | > --8<---8<8<-- > | > )abbrev domain MODMON ModMonic > | > ++ Description: > | > ++ This pack

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Bill Page
On Mon, Oct 24, 2011 at 1:02 PM, Gabriel Dos Reis wrote: > ... > Waldek Hebisch writes: > | I would not call this voodoo: the compiler performs reasonable type > | inference. > > There is nothing reasonable about it.  The way that most AXIOM compilers > do overload resolution (even in faces of ambi

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Waldek Hebisch writes: | Gabriel Dos Reis | > | > | > Consider the definition of ModMonoid: | > --8<---8<8<-- | > )abbrev domain MODMON ModMonic | > ++ Description: | > ++ This package \undocumented | > | > ModMonic(R,Rep)

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Waldek Hebisch
Gabriel Dos Reis > > > Consider the definition of ModMonoid: > --8<---8<8<-- > )abbrev domain MODMON ModMonic > ++ Description: > ++ This package \undocumented > > ModMonic(R,Rep): C == T > > Its description does not have

Re: [open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Bill Page writes: | On Mon, Oct 24, 2011 at 8:54 AM, Gabriel Dos Reis wrote: | > ... | > Now, consider the capsule-level variable "power".  It is declared as | > | >           power:PrimitiveArray(%) | > | > then later assigned to as | > | >           power := new(0,0) | > | > There are two lexi

Re: [open-axiom-devel] [fricas-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Bill Page
On Mon, Oct 24, 2011 at 8:54 AM, Gabriel Dos Reis wrote: > ... > Now, consider the capsule-level variable "power".  It is declared as > >           power:PrimitiveArray(%) > > then later assigned to as > >           power := new(0,0) > > There are two lexical occurences of the literal '0' in there

[open-axiom-devel] ModMonic and the Rep voodoo

2011-10-24 Thread Gabriel Dos Reis
Consider the definition of ModMonoid: --8<---8<8<-- )abbrev domain MODMON ModMonic ++ Description: ++ This package \undocumented ModMonic(R,Rep): C == T where R: Ring Rep: UnivariatePolynomialCategory(R)