[svn:parrot] r42190 - trunk/src/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Oct 31 14:36:06 UTC 2009
Author: bacek
Date: Sat Oct 31 14:36:05 2009
New Revision: 42190
URL: https://trac.parrot.org/parrot/changeset/42190
Log:
Add little bit of documentation about using different key and values types in
Hash.
Modified:
trunk/src/pmc/hash.pmc
Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc Sat Oct 31 14:26:49 2009 (r42189)
+++ trunk/src/pmc/hash.pmc Sat Oct 31 14:36:05 2009 (r42190)
@@ -30,6 +30,10 @@
=back
+By default Hash uses string keys and PMC values. Methods C<set_key_type> and
+C<set_value_type> used to switch key and values type. For C<PMC> keys
+hashvalue calculated using VTABLE C<get_hashvalue> function.
+
These are the vtable functions for the Hash PMC.
=head2 Functions
@@ -136,6 +140,8 @@
=item C<void set_integer(INTVAL type)>
+=item C<void set_key_type(INTVAL type)>
+
Reset Hash to use different keys. See enum C<Hash_key_type> for possible
values.
@@ -189,6 +195,15 @@
SELF.set_integer_native(type);
}
+/*
+
+=item C<METHOD get_key_type()>
+
+Return type of keys in Hash.
+
+=cut
+
+*/
METHOD get_key_type() {
const INTVAL ret = ((Hash *)SELF.get_pointer())->key_type;
RETURN(INTVAL ret);
More information about the parrot-commits
mailing list