cvs -q diff -u
Index: classes/orderedhash.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/orderedhash.pmc,v
retrieving revision 1.16
diff -u -u -r1.16 orderedhash.pmc
--- classes/orderedhash.pmc	22 Feb 2004 17:48:41 -0000	1.16
+++ classes/orderedhash.pmc	24 Feb 2004 20:00:15 -0000
@@ -153,6 +153,21 @@
     
 /*
 
+=item C<FLOATVAL get_number_keyed(PMC *key)>
+
+Returns the floating-point value for the element at C<*key>.
+
+=cut
+
+*/
+
+    FLOATVAL get_number_keyed (PMC* key) {
+        INTVAL n = PerlHash.SELF.get_integer_keyed(key);
+        return DYNSELF.get_number_keyed_int(n);
+    }
+
+/*
+
 =item C<void set_pmc_keyed(PMC *key, PMC *value)>
 
 Associates C<*value> with C<*key>.
@@ -185,6 +200,22 @@
 
 /*
 
+=item C<void set_string_keyed(PMC *key, STRING *value)>
+
+Associates C<value> with C<*key>.
+
+=cut
+
+*/
+
+    void set_string_keyed (PMC* key, STRING* value) {
+        INTVAL n = DYNSELF.elements();
+        DYNSELF.set_string_keyed_int(n, value);
+        PerlHash.SELF.set_integer_keyed(key, n);
+    }
+
+/*
+
 =item C<void set_pmc_keyed_str(STRING *key, PMC *value)>
 
 Associates C<*value> with C<*key>.
@@ -214,6 +245,36 @@
         DYNSELF.set_integer_keyed_int(n, value);
         PerlHash.SELF.set_integer_keyed_str(key, n);
     }
+
+/*
+
+=item C<void set_number_keyed (PMC *key, FLOATVAL value)>
+
+=cut
+
+*/
+
+    void set_number_keyed (PMC* key, FLOATVAL value) {
+        INTVAL n = DYNSELF.elements();
+        DYNSELF.set_number_keyed_int(n, value);
+        PerlHash.SELF.set_integer_keyed(key, n);
+    }
+
+/*
+
+=item C<void set_string_keyed_str(STRING *key, STRING *value)>
+
+=cut
+
+*/
+
+    void set_string_keyed_str (STRING* key, STRING* value) {
+        INTVAL n = DYNSELF.elements();
+        DYNSELF.set_string_keyed_int(n, value);
+        PerlHash.SELF.set_integer_keyed_str(key, n);
+    }
+
+/*
 
 /*
 
Index: classes/perlhash.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlhash.pmc,v
retrieving revision 1.68
diff -u -u -r1.68 perlhash.pmc
--- classes/perlhash.pmc	22 Feb 2004 17:48:41 -0000	1.68
+++ classes/perlhash.pmc	24 Feb 2004 20:00:15 -0000
@@ -104,6 +104,8 @@
 
 =item C<INTVAL type_keyed_str(STRING *key)>
 
+Returns the type of the element for C<*key>.
+
 =cut
 
 */
Index: t/pmc/orderedhash.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/orderedhash.t,v
retrieving revision 1.4
diff -u -u -r1.4 orderedhash.t
--- t/pmc/orderedhash.t	22 Feb 2004 22:55:29 -0000	1.4
+++ t/pmc/orderedhash.t	24 Feb 2004 20:00:26 -0000
@@ -10,13 +10,13 @@
 
 	% perl t/pmc/orderedhash.t
 
-=head1 DECSRIPTION
+=head1 DESCRIPTION
 
 Tests the C<OrderedHash> PMC.
 
 =cut
 
-use Parrot::Test tests => 10;
+use Parrot::Test tests => 17;
 use Test::More;
 
 output_is(<<'CODE', <<OUT, "init");
@@ -322,4 +322,160 @@
 ok \d/
 OUT
 
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash in PIR with PMC value");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    .local pmc val_in
+    val_in = new PerlString
+    val_in = "U"
+    hash1["X"] = val_in
+
+    .local pmc val_out
+    val_out = hash1['X']
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+U
+OUTPUT
+
+
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash set_integer_keyed");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    hash1["X"] = 14
+
+    .local pmc val_out
+    val_out = hash1['X']
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+14
+OUTPUT
+
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash set_string_keyed");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    .local string val1
+    val1 = 'U'
+    set hash1["X"], val1
+
+    .local pmc val_out
+    val_out = hash1['X']
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+U
+OUTPUT
+
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash set_string_keyed");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    hash1["X"] = '14'
+
+    .local pmc val_out
+    val_out = hash1['X']
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+14
+OUTPUT
+
+
+# actually Parrot_OrderedHash_set_string_keyed is used, why ?
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash set_string_keyed_str");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    .local string key1
+    key1 = 'X'
+
+    hash1[key1] = '15'
+
+    .local pmc val_out
+    val_out = hash1[key1]
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+15
+OUTPUT
+
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash set_number_keyed");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+    .local string key1
+    key1 = 'X'
+
+    hash1[key1] = -16.16
+
+    .local pmc val_out
+    val_out = hash1[key1]
+    print val_out
+    print "\n"
+
+    end
+.end
+CODE
+-16.160000
+OUTPUT
+
+output_is(<< 'CODE', << 'OUTPUT', "OrderedHash get_integer");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new OrderedHash
+
+    .local int hash_size
+    hash_size = hash1
+    print hash_size
+    print "\n"
+
+    hash1['X'] = 'U'
+    hash_size = hash1
+    print hash_size
+    print "\n"
+
+    hash1['Y'] = 'V'
+    hash_size = hash1
+    print hash_size
+    print "\n"
+
+    hash1['size'] = hash_size
+    hash_size = hash1
+    print hash_size
+    print "\n"
+
+    end
+.end
+CODE
+0
+1
+2
+3
+OUTPUT
 
Index: t/pmc/perlhash.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/perlhash.t,v
retrieving revision 1.39
diff -u -u -r1.39 perlhash.t
--- t/pmc/perlhash.t	22 Feb 2004 22:55:29 -0000	1.39
+++ t/pmc/perlhash.t	24 Feb 2004 20:00:26 -0000
@@ -18,7 +18,9 @@
 
 =cut
 
-use Parrot::Test tests => 31;
+# $Id$
+
+use Parrot::Test tests => 32;
 use Test::More;
 
 output_is(<<CODE, <<OUTPUT, "Initial PerlHash tests");
@@ -995,6 +997,19 @@
 euro
 OUTPUT
 
-
-1;
+output_is(<< 'CODE', << 'OUTPUT', "PerlHash in PIR");
+##PIR##
+.sub _main
+    .local pmc hash1
+    hash1 = new PerlHash
+    hash1['X'] = 'U'
+    .local string val1
+    val1 = hash1['X']
+    print val1
+    print "\n"
+    end
+.end
+CODE
+U
+OUTPUT

