[Aldor-l] (Integer, String) ~= (Integer, String)
Martin Rubey
martin.rubey at univie.ac.at
Wed Nov 26 05:01:08 EST 2008
Maybe the following shows the problem even more drastically. After
Create(T: Tuple OutputType, t: Cross T): Test T == t pretend Test T;
the compiler will complain about Create(T2, c2) with exactly the same words as
Ralf noticed...
Martin
Ralf Hemmecke <ralf at hemmecke.de> writes:
> 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
>
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org
More information about the Aldor-l
mailing list