On Sat, 4 Apr 2009, Xiao Yafeng wrote:

3. Could I define primary key for a bag variable?

All items in a Bag are "primary keys", but there's no data additional
data associated with it.

    I mean whether I can see Set as a table  and Bag as a table with a
unique constraint? like:
       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.

        HTH,


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to