[Aldor-l] Generators (destructuring cross)
Bill Page
bill.page at newsynthesis.org
Wed Nov 7 19:18:33 EST 2007
On 07 Nov 2007 19:47:42 +0100, Martin Rubey <martin.rubey at univie.ac.at> wrote:
> Dear Peter, Francois,
>
> well, I had to try it, and I'm quite amazed. It's beautiful.
>
> It does not work for dependent crosses, but that's probably too much too ask
> for, as the compiler doesn't like them too much...
>
Maybe this alternate coding helps to explain why it doesn't and
perhaps why we should not expect it to work for dependent crosses ('a'
is not constant in this scope):
#if DoesntCompile
stdout << "test dependent:" << newline;
-- Cross(n: MachineInteger, SmallPrimeField n)
for (a:MachineInteger, b:SmallPrimeField a) in g repeat {
stdout << a << " " << b << newline;
}
#endif
root at sage:~/aldor-src/aldor/install/aldor# aldor -fx -lalgebra
-laldor -DWantRuntimeError -DDoesntCompile crossiterator.as
"crossiterator.as", line 63:
for (a:MachineInteger, b:SmallPrimeField a) in g repeat {
............^
[L63 C13] #1 (Error) `a' is used in a type, so must be constant, and
so cannot be assigned to.
Regards,
Bill Page.
More information about the Aldor-l
mailing list