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 is that the type of leftLcm is
>
>
> (P,P) -> P
>
> and before starting the compilation of a function body, the compiler
> automatically imports the return type and domain of each parameter.
> So the modemap of 0@P happens to be first on the list, and since the
> compilers the first that makes tentative compilation OK, it picks it and
> moves on.
>
So here it seems very clear that one should have written:
v:P := 0
and the use of
v := 0
should produce an error message. I retrospect I think I have probably
been bitten by this bug a few times in the past. One just seems to get
used to working around such limitations. But this seems like an
improvement to me even if it does affect a lot of existing code that
happens to work right now. A sensible error message would be welcome.
Would this be hard to do?
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.