On 04/01/2006 09:15 PM, Antoine Hersen wrote:
Sorry,

Here it is http://wiki.axiom-developer.org/SandBoxSpad

If I try to use the map the compilation fail

I am used to Ocaml who do a terrific job at inferring type( which are
more simple) and I have trouble figuring out where to add type
information.

Actually, I don't understand you Antoine.
[degree i for i in a]
does the same job as your map stuff. And it works.

Second, please start using Aldor. I don't understand why you insist on using SPAD. Take for example

(i) +-> degree i

You put this (anonymous) function without giving types. So you rely on what the compiler thinks is appropriate in your case.

What can the compiler do if it sees

map(f, a)

where f is the (untyped) function from above.
It figures out the type of a, that is clearly "List P".
OK, it also sees that List(P) provides a function
map: (P -> P, %) -> %
Now the compiler must somehow try to fit your anonymous untyped function to the type P->P. Which is actually impossible, since there is no
degree: P->P. The compiler must complain!!!
The bad thing is only that the error message does not say much about the reason if you are (like me) unfamiliar with that output.

Well, anyway, use Aldor and enjoy better error messages.

Ralf



_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to