[Aldor-l] (Integer, String) ~= (Integer, String)
Ralf Hemmecke
ralf at hemmecke.de
Mon Nov 24 19:12:13 EST 2008
The code below compiles with
aldor -grun -laldor -DPRETEND abc.as
but fails at
aldor -grun -laldor abc.as
"abc.as", line 32: e2: Test T2 := create(c2)$Test(T2);
..............................^
[L32 C31] #1 (Error) Argument 1 of `create$Test(AldorInteger, String)'
did not match any possible parameter type.
The rejected type is Cross(AldorInteger, String).
Expected type Cross(AldorInteger, String).
Any idea how I could do without 'pretend' in the 'main' function?
Note that a user could easily provid T3==>(String, Character, Integer)
and do similar things on the command line instead of inside a 'main'
function.
Ralf
---BEGIN abc.as
#include "aldor"
Test(T: Tuple OutputType): with {
create: Cross T -> %;
}
== add {
import from Trace;
Rep == Cross T;
create(c: Cross T): % == per c;
}
main(): () == {
import from String, Integer;
T2 ==> (Integer, String);
t2: Tuple(OutputType) == T2;
c2: Cross T2 := (1783, "Hallo");
#if PRETEND
e2: Test t2 := create(c2 pretend Cross t2);
#else
e2: Test T2 := create(c2)$Test(T2);
#endif
}
main();
---END abc.as
More information about the Aldor-l
mailing list