axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] "has" and "with" (was curious algebra failure)


From: Gabriel Dos Reis
Subject: Re: [Axiom-developer] "has" and "with" (was curious algebra failure)
Date: Mon, 13 Aug 2007 10:42:26 -0500 (CDT)

On Mon, 13 Aug 2007, William Sit wrote:

| 
| 
| Gabriel Dos Reis wrote:
| 
| > On Sun, 12 Aug 2007, William Sit wrote:
| >
| > | Isn't the problem whether 'Monad has SetCategory with "*":(%,%)->%' ?
| >
| > If the question is formulated in terms of "has", then I think the answer
| > is unambiguously "yes".
| >
| > But, is that the way the compiler is intended or does the matching of
| > actual arguments with formal parameters?
| >
| > It seems to me that the compiler asks the question in terms of coercible,
| > instead of "has".
| >
| > -- Gaby
| 
| I believe for category parameters, the compiler checks whether the supplied 
domain
| "has" the category, and for domain parameters, the compiler checks whether the
| object belongs to the domain, NOT whether the object is "coercible" to it.

Here is what is happenning when I trace the following functions:

  coerceEasy coerceSubset coerceHard coerceable compImport compExpression
  compForm compForm1


When compiling the default definition of ** for Monad, the compiler
notices that expt comes from RepeatedSquare(S), where S is the
parameter of type Monad to Monad&.  If compiles all arguments x and n fine.
Then it has to compile the package RepeatedSquare(S) -- as if it were
a function call, since all instantiations are function calls.  To achieve 
that it asks the question whether S (of type Monad) is coercible to

   SetCategory with "*": (%, %) -> %

And the definition of coercible does not permit to return "yes".


-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]