On 01/27/2012 08:44 PM, Waldek Hebisch wrote:
Ralf Hemmecke wrote:Hello, I cannot compile the following program, but I don't actually want to export coerce: %->X. ---rhxBEGIN tst.spad )abbrev domain MEX MExpression X ==> Integer MExpression: with coerce: X -> % == add Rep == X coerce(a: X): % == a pretend % coerce(a: %): X == a pretend X ---rhxEND tst.spad Well, renaming the offending coerce into localcoerce, makes the program compile, but it would be much nicer if I don't have to do this. These functions are distinguishable not only by there result type, but already by their input type.<snip>compiling local coerce : $ -> Integer >> Apparent user error: coerce is local and exportedI met this problem before and I am not sure what to do. On one hand this is rather arbitrary restriction. OTOH given that normally Spad compiler is very permisive it seems that original author thought that this restriction is important.
As I said above, since there is a simple workaround, I can live with the restriction for the moment.
I don't, however, think that this restriction of the SPAD compiler should stay forever. I am not aware that any language specification says that having two implementations of functions with the same name (and different type) and exporting only one of them should be impossible.
Waldek, whenever you can spare some minutes on this topic, I would be grateful.
Ralf -- 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.
