Skip to content

Commit

Permalink
[tcl]
Browse files Browse the repository at this point in the history
Remove (now) unecessary vtable overrides. Probably obsoleted by improvements
to the object system.



git-svn-id: https://svn.parrot.org/parrot/trunk@26979 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
coke committed Apr 15, 2008
1 parent e2ae3a7 commit d37b9f8
Showing 1 changed file with 3 additions and 53 deletions.
56 changes: 3 additions & 53 deletions languages/tcl/src/pmc/tcldict.pmc
@@ -1,13 +1,6 @@
/* TclDict.pmc
* Copyright (C) 2001-2003, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
* These are the vtable functions for the TclDict base class
* Data Structure and Algorithms:
* History:
* Notes:
* References:
/*
* Copyright (C) 2001-2008, The Perl Foundation.
* $Id$

=head1 NAME

Expand Down Expand Up @@ -37,49 +30,6 @@ pmclass TclDict
maps Hash
{

/*

=item C<void assign_pmc(PMC *other)>

Copy the contents of other to self.

=cut

*/

void set_pmc(PMC *other) {
SELF.assign_pmc(other);
}

void assign_pmc(PMC *other) {
STRING *hash = string_from_cstring(INTERP, "hash", 4);
STRING *undef = string_from_cstring(INTERP, "Undef", 5);

if (VTABLE_does(INTERP, other, hash))
{
PMC *iter = pmc_new_init(INTERP, enum_class_Iterator, other);

pmc_reuse(INTERP, SELF, SELF->vtable->base_type, 0);
while (VTABLE_get_bool(INTERP, iter))
{
STRING *key = VTABLE_shift_string(INTERP, iter);
PMC *value = VTABLE_get_pmc_keyed_str(INTERP, other, key);
VTABLE_set_pmc_keyed_str(INTERP, SELF, key, value);
}
}
else if (VTABLE_isa(INTERP, other, undef))
{
pmc_reuse(INTERP, SELF, other->vtable->base_type, 0);
}
else
{
real_exception(INTERP, NULL, E_TypeError,
"unable to assign self to this TclDict");
}
}

/*

=item C<STRING *get_string()>

Returns the dict as a string
Expand Down

0 comments on commit d37b9f8

Please sign in to comment.