/*
Copyright (C) 2001-2006, The Perl Foundation.
$Id: perlhash.pmc 16836 2007-01-30 04:30:52Z coke $

=head1 NAME

src/dynpmc/perlhash.pmc - PerlHash PMC

=head1 DESCRIPTION

These are the vtable functions for the PerlHash PMC.

=head2 Functions

=over 4

=cut

*/

#include "parrot/parrot.h"

/* Albeit PerlHash doesn't use PMC_data, it needs the next_for_GC pointer
 * We would get recursive marking of a deeply nested HoHoH...
 */

static INTVAL _PerlUndef;

pmclass PerlHash
    extends Hash
    need_ext
    does hash
    dynpmc
    group perl_group
    hll Perl
    maps Hash {

    void class_init() {
        _PerlUndef = pmc_type(INTERP,
                string_from_const_cstring(INTERP, "PerlUndef", 0));
    }

    PMC* get_pmc_keyed(PMC *key) {
        PMC *result = SUPER(key);
        if (PMC_IS_NULL(result))
            return pmc_new(INTERP, _PerlUndef);
        return result;
    }

}

/*

=back

=head1 SEE ALSO

F<docs/pdds/pdd08_keys.pod>.
F<src/pmc/hash.pmc>.

=cut

*/

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
