[Challenge] implementing the ambiguous operator in D

Peter Alexander peter.alexander.au at gmail.com
Mon Sep 6 04:51:15 PDT 2010


== Quote from Andrei Alexandrescu
> Yah, per your follow-up post, it's a different problem. It's
also a much
> more difficult one. I convinced myself crossProduct is
impossible to
> implement if one input range and one infinite forward range are
> simultaneously present. It works with any number of infinite
forward
> ranges, and also with other combinations. I couldn't formalize
the exact
> requirements yet.

I must be missing something, because I don't understand how you
could possibly take the cross product of any number of infinite
ranges (other than to just return the range of (a[0], b[i]) for
all (infinitely many) i in b).

Note that I'm assuming you mean cartesian product, rather than
cross product; I've never heard cross product used in the context
of sets.


More information about the Digitalmars-d mailing list