Timothy S. Nelson wrote:
On Sat, 4 Apr 2009, Xiao Yafeng wrote:
    I mean whether I can see Set as a table  and Bag as a table with a
unique constraint? like:

I think you have that backwards. A Set is conceptually like a Bag with a uniqueness constraint, not the other way around.

subset test of Bag(test_name Str, test_ID Int, primary key(test_ID))

I don't think you can really do something like that. Perl 6 as specified leaves many things up to libraries. Implementing a Table type will no doubt be one of those things. I would like to have a Table type that will work well with the Tree/Plex type that I am working on.

In the meantime, a table would need to be represented as an array of hashes, or a hash of arrays.

Speaking of libraries, I already implemented a table type ... it's called Set::Relation/::V2 and its on CPAN right now ... for Perl 5 ... I still have to port it to Perl 6, unless someone else wants to do that, but I designed it so that would be easy to do. The port could stand for some additional Perl 6 savvyness too.

-- Darren Duncan

Reply via email to