#1815 Cartesian product?

Xan Tue 6 Mar 2012

Hi,

I want to know how to do something like this:

[Str:(Type,Obj)] Tags := [:]

where we have map from Str to Type x Obj (cartesian product of Type and Object). Is it possible to define this? Is this possible to define limited length lists?

Thanks in advance,

brian Tue 6 Mar 2012

Fantom doesn't have tuples. So you would need to either model untyped as Obj[] or create class that modeled a Type/Obj pair.

Xan Wed 7 Mar 2012

Pain!!. I think I will implement the Class, but it's an ad-hoc solution

Thanks, Xan.

Xan Wed 7 Mar 2012

Did you consider to implement Tuples? Overall for Geometry and Mathematical functions.

brian Wed 7 Mar 2012

Did you consider to implement Tuples?

There has been much past discussion, but I don't think we'll add them (at least not before we do lots of other stuff)

Xan Wed 7 Mar 2012

A pain!. A Tuple(N) class is useful to have.

Login or Signup to reply.