lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [1/3] Rename Clownfish::VTable to Clownfish::Class
Date Sun, 06 Jul 2014 15:43:29 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 5fc451355 -> b85791907


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Obj.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Obj.c b/runtime/core/Clownfish/Obj.c
index d76ea19..db6e44b 100644
--- a/runtime/core/Clownfish/Obj.c
+++ b/runtime/core/Clownfish/Obj.c
@@ -15,7 +15,7 @@
  */
 
 #define C_CFISH_OBJ
-#define C_CFISH_VTABLE
+#define C_CFISH_CLASS
 #define CFISH_USE_SHORT_NAMES
 #define CHY_USE_SHORT_NAMES
 
@@ -29,7 +29,7 @@
 #include "Clownfish/String.h"
 #include "Clownfish/Err.h"
 #include "Clownfish/Hash.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 #include "Clownfish/Util/Memory.h"
 
 Obj*
@@ -50,14 +50,14 @@ Obj_Hash_Sum_IMP(Obj *self) {
 }
 
 bool
-Obj_Is_A_IMP(Obj *self, VTable *ancestor) {
-    VTable *vtable = self ? self->vtable : NULL;
+Obj_Is_A_IMP(Obj *self, Class *ancestor) {
+    Class *klass = self ? self->klass : NULL;
 
-    while (vtable != NULL) {
-        if (vtable == ancestor) {
+    while (klass != NULL) {
+        if (klass == ancestor) {
             return true;
         }
-        vtable = vtable->parent;
+        klass = klass->parent;
     }
 
     return false;
@@ -89,14 +89,14 @@ Obj_To_Bool_IMP(Obj *self) {
     return !!Obj_To_I64(self);
 }
 
-VTable*
-Obj_Get_VTable_IMP(Obj *self) {
-    return self->vtable;
+Class*
+Obj_Get_Class_IMP(Obj *self) {
+    return self->klass;
 }
 
 String*
 Obj_Get_Class_Name_IMP(Obj *self) {
-    return VTable_Get_Name(self->vtable);
+    return Class_Get_Name(self->klass);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Obj.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Obj.cfh b/runtime/core/Clownfish/Obj.cfh
index fafccfc..669accf 100644
--- a/runtime/core/Clownfish/Obj.cfh
+++ b/runtime/core/Clownfish/Obj.cfh
@@ -21,7 +21,7 @@ parcel Clownfish;
 
 public class Clownfish::Obj {
 
-    VTable *vtable;
+    Class *klass;
 
     /** Abstract initializer.
      */
@@ -79,13 +79,13 @@ public class Clownfish::Obj {
     public void
     Destroy(Obj *self);
 
-    /** Invoke the Destroy() method found in <code>vtable</code> on
+    /** Invoke the Destroy() method found in <code>klass</code> on
      * <code>self</code>.
      *
      * TODO: Eliminate this function if we can arrive at a proper SUPER syntax.
      */
     inert inline void
-    super_destroy(Obj *self, VTable *vtable);
+    super_destroy(Obj *self, Class *klass);
 
     /** Indicate whether two objects are the same.  By default, compares the
      * memory address.
@@ -111,10 +111,10 @@ public class Clownfish::Obj {
     public int32_t
     Hash_Sum(Obj *self);
 
-    /** Return the object's VTable.
+    /** Return the object's Class.
      */
-    public VTable*
-    Get_VTable(Obj *self);
+    public Class*
+    Get_Class(Obj *self);
 
     /** Return the name of the class that the object belongs to.
      */
@@ -124,7 +124,7 @@ public class Clownfish::Obj {
     /** Indicate whether the object is a descendent of <code>ancestor</code>.
      */
     public bool
-    Is_A(Obj *self, VTable *ancestor);
+    Is_A(Obj *self, Class *ancestor);
 
     /** Generic stringification: "ClassName@hex_mem_address".
      */
@@ -156,14 +156,14 @@ public class Clownfish::Obj {
 
 __C__
 static CFISH_INLINE void
-cfish_Obj_super_destroy(cfish_Obj *self, cfish_VTable *vtable) {
+cfish_Obj_super_destroy(cfish_Obj *self, cfish_Class *class) {
     CFISH_Obj_Destroy_t super_destroy
-        = CFISH_SUPER_METHOD_PTR(vtable, CFISH_Obj_Destroy);
+        = CFISH_SUPER_METHOD_PTR(class, CFISH_Obj_Destroy);
     super_destroy(self);
 }
 
-#define CFISH_SUPER_DESTROY(_self, _vtable) \
-    cfish_Obj_super_destroy((cfish_Obj*)_self, _vtable)
+#define CFISH_SUPER_DESTROY(_self, _class) \
+    cfish_Obj_super_destroy((cfish_Obj*)_self, _class)
 
 static CFISH_INLINE cfish_Obj*
 cfish_Obj_incref(cfish_Obj *self) {
@@ -182,7 +182,7 @@ cfish_Obj_decref(cfish_Obj *self) {
 #define CFISH_DECREF(_self) cfish_Obj_decref((cfish_Obj*)_self)
 
 #ifdef CFISH_USE_SHORT_NAMES
-  #define SUPER_DESTROY(_self, _vtable)   CFISH_SUPER_DESTROY(_self, _vtable)
+  #define SUPER_DESTROY(_self, _class)    CFISH_SUPER_DESTROY(_self, _class)
   #define INCREF(_self)                   CFISH_INCREF(_self)
   #define DECREF(_self)                   CFISH_DECREF(_self)
 #endif

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/String.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.c b/runtime/core/Clownfish/String.c
index 9f691ad..2b1f854 100644
--- a/runtime/core/Clownfish/String.c
+++ b/runtime/core/Clownfish/String.c
@@ -28,7 +28,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 #include "Clownfish/String.h"
 
 #include "Clownfish/CharBuf.h"
@@ -56,13 +56,13 @@ Str_new_from_utf8(const char *utf8, size_t size) {
     if (!StrHelp_utf8_valid(utf8, size)) {
         DIE_INVALID_UTF8(utf8, size);
     }
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_from_trusted_utf8(self, utf8, size);
 }
 
 String*
 Str_new_from_trusted_utf8(const char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_from_trusted_utf8(self, utf8, size);
 }
 
@@ -88,13 +88,13 @@ Str_new_steal_utf8(char *utf8, size_t size) {
     if (!StrHelp_utf8_valid(utf8, size)) {
         DIE_INVALID_UTF8(utf8, size);
     }
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_steal_trusted_utf8(self, utf8, size);
 }
 
 String*
 Str_new_steal_trusted_utf8(char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_steal_trusted_utf8(self, utf8, size);
 }
 
@@ -111,13 +111,13 @@ Str_new_wrap_utf8(const char *utf8, size_t size) {
     if (!StrHelp_utf8_valid(utf8, size)) {
         DIE_INVALID_UTF8(utf8, size);
     }
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_wrap_trusted_utf8(self, utf8, size);
 }
 
 String*
 Str_new_wrap_trusted_utf8(const char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     return Str_init_wrap_trusted_utf8(self, utf8, size);
 }
 
@@ -136,7 +136,7 @@ Str_new_from_char(int32_t code_point) {
     size_t  size = StrHelp_encode_utf8_char(code_point, (uint8_t*)ptr);
     ptr[size] = '\0';
 
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
     self->ptr    = ptr;
     self->size   = size;
     self->origin = self;
@@ -157,7 +157,7 @@ Str_newf(const char *pattern, ...) {
 
 static String*
 S_new_substring(String *string, size_t byte_offset, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
+    String *self = (String*)Class_Make_Obj(STRING);
 
     if (string->origin == NULL) {
         // Copy substring of wrapped strings.
@@ -176,7 +176,7 @@ Obj*
 Str_Inc_RefCount_IMP(String *self) {
     if (self->origin == NULL) {
         // Copy wrapped strings when the refcount is increased.
-        String *copy = (String*)VTable_Make_Obj(STRING);
+        String *copy = (String*)Class_Make_Obj(STRING);
         return (Obj*)Str_init_from_trusted_utf8(copy, self->ptr, self->size);
     }
     else {
@@ -336,7 +336,7 @@ Str_Cat_Trusted_Utf8_IMP(String *self, const char* ptr, size_t size) {
     memcpy(result_ptr, self->ptr, self->size);
     memcpy(result_ptr + self->size, ptr, size);
     result_ptr[result_size] = '\0';
-    String *result = (String*)VTable_Make_Obj(STRING);
+    String *result = (String*)Class_Make_Obj(STRING);
     return Str_init_steal_trusted_utf8(result, result_ptr, result_size);
 }
 
@@ -553,7 +553,7 @@ SStr_new_from_str(void *allocation, size_t alloc_size, String *string) {
     memcpy(ptr, string->ptr, size);
     ptr[size] = '\0';
 
-    StackString *self = (StackString*)VTable_Init_Obj(STACKSTRING, allocation);
+    StackString *self = (StackString*)Class_Init_Obj(STACKSTRING, allocation);
     self->ptr    = ptr;
     self->size   = size;
     self->origin = NULL;
@@ -563,7 +563,7 @@ SStr_new_from_str(void *allocation, size_t alloc_size, String *string) {
 StackString*
 SStr_wrap_str(void *allocation, const char *ptr, size_t size) {
     StackString *self
-        = (StackString*)VTable_Init_Obj(STACKSTRING, allocation);
+        = (StackString*)Class_Init_Obj(STACKSTRING, allocation);
     self->size   = size;
     self->ptr    = ptr;
     self->origin = NULL;
@@ -589,7 +589,7 @@ SStr_Destroy_IMP(StackString *self) {
 
 StringIterator*
 StrIter_new(String *string, size_t byte_offset) {
-    StringIterator *self = (StringIterator*)VTable_Make_Obj(STRINGITERATOR);
+    StringIterator *self = (StringIterator*)Class_Make_Obj(STRINGITERATOR);
     self->string      = (String*)INCREF(string);
     self->byte_offset = byte_offset;
     return self;
@@ -903,7 +903,7 @@ StrIter_Destroy_IMP(StringIterator *self) {
 StackStringIterator*
 SStrIter_new(void *allocation, String *string, size_t byte_offset) {
     StackStringIterator *self
-        = (StackStringIterator*)VTable_Init_Obj(STACKSTRINGITERATOR,
+        = (StackStringIterator*)Class_Init_Obj(STACKSTRINGITERATOR,
                                                 allocation);
     // Assume that the string will be available for the lifetime of the
     // iterator and don't increase its refcount.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestByteBuf.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestByteBuf.c b/runtime/core/Clownfish/Test/TestByteBuf.c
index dcea3b5..3aba1f1 100644
--- a/runtime/core/Clownfish/Test/TestByteBuf.c
+++ b/runtime/core/Clownfish/Test/TestByteBuf.c
@@ -25,11 +25,11 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestByteBuf*
 TestBB_new() {
-    return (TestByteBuf*)VTable_Make_Obj(TESTBYTEBUF);
+    return (TestByteBuf*)Class_Make_Obj(TESTBYTEBUF);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestCharBuf.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestCharBuf.c b/runtime/core/Clownfish/Test/TestCharBuf.c
index 48c36a1..4070ae7 100644
--- a/runtime/core/Clownfish/Test/TestCharBuf.c
+++ b/runtime/core/Clownfish/Test/TestCharBuf.c
@@ -31,14 +31,14 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
 static uint32_t smiley_len = 3;
 
 TestCharBuf*
 TestCB_new() {
-    return (TestCharBuf*)VTable_Make_Obj(TESTCHARBUF);
+    return (TestCharBuf*)Class_Make_Obj(TESTCHARBUF);
 }
 
 static CharBuf*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestErr.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestErr.c b/runtime/core/Clownfish/Test/TestErr.c
index 5627d7d..b31313d 100644
--- a/runtime/core/Clownfish/Test/TestErr.c
+++ b/runtime/core/Clownfish/Test/TestErr.c
@@ -23,11 +23,11 @@
 #include "Clownfish/Err.h"
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestErr*
 TestErr_new() {
-    return (TestErr*)VTable_Make_Obj(TESTERR);
+    return (TestErr*)Class_Make_Obj(TESTERR);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestHash.c b/runtime/core/Clownfish/Test/TestHash.c
index e5000c9..54ec399 100644
--- a/runtime/core/Clownfish/Test/TestHash.c
+++ b/runtime/core/Clownfish/Test/TestHash.c
@@ -29,11 +29,11 @@
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestHash*
 TestHash_new() {
-    return (TestHash*)VTable_Make_Obj(TESTHASH);
+    return (TestHash*)Class_Make_Obj(TESTHASH);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestLockFreeRegistry.c b/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
index 515db9a..4f69ce0 100644
--- a/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
+++ b/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
@@ -27,11 +27,11 @@
 #include "Clownfish/LockFreeRegistry.h"
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestLockFreeRegistry*
 TestLFReg_new() {
-    return (TestLockFreeRegistry*)VTable_Make_Obj(TESTLOCKFREEREGISTRY);
+    return (TestLockFreeRegistry*)Class_Make_Obj(TESTLOCKFREEREGISTRY);
 }
 
 StupidHashCharBuf*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestNum.c b/runtime/core/Clownfish/Test/TestNum.c
index f84c2c0..c30a169 100644
--- a/runtime/core/Clownfish/Test/TestNum.c
+++ b/runtime/core/Clownfish/Test/TestNum.c
@@ -24,11 +24,11 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestNum*
 TestNum_new() {
-    return (TestNum*)VTable_Make_Obj(TESTNUM);
+    return (TestNum*)Class_Make_Obj(TESTNUM);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestObj.c b/runtime/core/Clownfish/Test/TestObj.c
index 63e2bae..7b4a955 100644
--- a/runtime/core/Clownfish/Test/TestObj.c
+++ b/runtime/core/Clownfish/Test/TestObj.c
@@ -28,22 +28,22 @@
 #include "Clownfish/Err.h"
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestObj*
 TestObj_new() {
-    return (TestObj*)VTable_Make_Obj(TESTOBJ);
+    return (TestObj*)Class_Make_Obj(TESTOBJ);
 }
 
 static Obj*
 S_new_testobj() {
-    StackString *klass = SSTR_WRAP_UTF8("TestObj", 7);
+    StackString *class_name = SSTR_WRAP_UTF8("TestObj", 7);
     Obj *obj;
-    VTable *vtable = VTable_fetch_vtable((String*)klass);
-    if (!vtable) {
-        vtable = VTable_singleton((String*)klass, OBJ);
+    Class *klass = Class_fetch_class((String*)class_name);
+    if (!klass) {
+        klass = Class_singleton((String*)class_name, OBJ);
     }
-    obj = VTable_Make_Obj(vtable);
+    obj = Class_Make_Obj(klass);
     return Obj_init(obj);
 }
 
@@ -99,13 +99,13 @@ test_Hash_Sum(TestBatchRunner *runner) {
 static void
 test_Is_A(TestBatchRunner *runner) {
     String *string     = Str_new_from_trusted_utf8("", 0);
-    VTable *str_vtable = Str_Get_VTable(string);
-    String *klass      = Str_Get_Class_Name(string);
+    Class  *str_class  = Str_Get_Class(string);
+    String *class_name = Str_Get_Class_Name(string);
 
     TEST_TRUE(runner, Str_Is_A(string, STRING), "String Is_A String.");
     TEST_TRUE(runner, Str_Is_A(string, OBJ), "String Is_A Obj.");
-    TEST_TRUE(runner, str_vtable == STRING, "Get_VTable");
-    TEST_TRUE(runner, Str_Equals(VTable_Get_Name(STRING), (Obj*)klass),
+    TEST_TRUE(runner, str_class == STRING, "Get_Class");
+    TEST_TRUE(runner, Str_Equals(Class_Get_Name(STRING), (Obj*)class_name),
               "Get_Class_Name");
 
     DECREF(string);
@@ -156,7 +156,7 @@ S_verify_abstract_error(TestBatchRunner *runner, Err_Attempt_t routine,
 
 static void
 test_abstract_routines(TestBatchRunner *runner) {
-    Obj *blank = VTable_Make_Obj(OBJ);
+    Obj *blank = Class_Make_Obj(OBJ);
     S_verify_abstract_error(runner, S_attempt_init, blank, "init");
 
     Obj *obj = S_new_testobj();

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestString.c b/runtime/core/Clownfish/Test/TestString.c
index 634154a..17c8354 100644
--- a/runtime/core/Clownfish/Test/TestString.c
+++ b/runtime/core/Clownfish/Test/TestString.c
@@ -32,7 +32,7 @@
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
 #include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 #define SMILEY "\xE2\x98\xBA"
 static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
@@ -41,7 +41,7 @@ static uint32_t smiley_cp  = 0x263A;
 
 TestString*
 TestStr_new() {
-    return (TestString*)VTable_Make_Obj(TESTSTRING);
+    return (TestString*)Class_Make_Obj(TESTSTRING);
 }
 
 static String*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestVArray.c b/runtime/core/Clownfish/Test/TestVArray.c
index 06c1590..4a9334f 100644
--- a/runtime/core/Clownfish/Test/TestVArray.c
+++ b/runtime/core/Clownfish/Test/TestVArray.c
@@ -30,11 +30,11 @@
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestUtils.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestVArray*
 TestVArray_new() {
-    return (TestVArray*)VTable_Make_Obj(TESTVARRAY);
+    return (TestVArray*)Class_Make_Obj(TESTVARRAY);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/Util/TestAtomic.c b/runtime/core/Clownfish/Test/Util/TestAtomic.c
index 320ff91..f87279a 100644
--- a/runtime/core/Clownfish/Test/Util/TestAtomic.c
+++ b/runtime/core/Clownfish/Test/Util/TestAtomic.c
@@ -22,11 +22,11 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/Atomic.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestAtomic*
 TestAtomic_new() {
-    return (TestAtomic*)VTable_Make_Obj(TESTATOMIC);
+    return (TestAtomic*)Class_Make_Obj(TESTATOMIC);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/Util/TestMemory.c b/runtime/core/Clownfish/Test/Util/TestMemory.c
index 1878242..0f1278f 100644
--- a/runtime/core/Clownfish/Test/Util/TestMemory.c
+++ b/runtime/core/Clownfish/Test/Util/TestMemory.c
@@ -25,11 +25,11 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestMemory*
 TestMemory_new() {
-    return (TestMemory*)VTable_Make_Obj(TESTMEMORY);
+    return (TestMemory*)Class_Make_Obj(TESTMEMORY);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/Util/TestNumberUtils.c b/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
index 5840c34..09dc894 100644
--- a/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
+++ b/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
@@ -30,11 +30,11 @@
 #include "Clownfish/TestHarness/TestUtils.h"
 #include "Clownfish/Util/Memory.h"
 #include "Clownfish/Util/NumberUtils.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestNumberUtils*
 TestNumUtil_new() {
-    return (TestNumberUtils*)VTable_Make_Obj(TESTNUMBERUTILS);
+    return (TestNumberUtils*)Class_Make_Obj(TESTNUMBERUTILS);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/Util/TestStringHelper.c b/runtime/core/Clownfish/Test/Util/TestStringHelper.c
index 339de02..bcf33a2 100644
--- a/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ b/runtime/core/Clownfish/Test/Util/TestStringHelper.c
@@ -26,7 +26,7 @@
 #include "Clownfish/Test.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 /* This alternative implementation of utf8_valid() is (presumably) slower, but
  * it implements the standard in a more linear, easy-to-grok way.
@@ -34,7 +34,7 @@
 #define TRAIL_OK(n) (n >= 0x80 && n <= 0xBF)
 TestStringHelper*
 TestStrHelp_new() {
-    return (TestStringHelper*)VTable_Make_Obj(TESTSTRINGHELPER);
+    return (TestStringHelper*)Class_Make_Obj(TESTSTRINGHELPER);
 }
 
 static bool

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/TestHarness/TestBatchRunner.c b/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
index 72cebf2..a237df9 100644
--- a/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
+++ b/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
@@ -28,7 +28,7 @@
 #include "Clownfish/TestHarness/TestBatch.h"
 #include "Clownfish/TestHarness/TestFormatter.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 struct try_run_tests_context {
     TestBatchRunner *runner;
@@ -44,7 +44,7 @@ S_vtest_true(TestBatchRunner *self, bool condition, const char *pattern,
 
 TestBatchRunner*
 TestBatchRunner_new(TestFormatter *formatter) {
-    TestBatchRunner *self = (TestBatchRunner*)VTable_Make_Obj(TESTBATCHRUNNER);
+    TestBatchRunner *self = (TestBatchRunner*)Class_Make_Obj(TESTBATCHRUNNER);
     return TestBatchRunner_init(self, formatter);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/TestHarness/TestFormatter.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/TestHarness/TestFormatter.c b/runtime/core/Clownfish/TestHarness/TestFormatter.c
index c5016be..529ed1d 100644
--- a/runtime/core/Clownfish/TestHarness/TestFormatter.c
+++ b/runtime/core/Clownfish/TestHarness/TestFormatter.c
@@ -29,7 +29,7 @@
 #include "Clownfish/TestHarness/TestBatch.h"
 #include "Clownfish/TestHarness/TestSuiteRunner.h"
 #include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestFormatter*
 TestFormatter_init(TestFormatter *self) {
@@ -65,7 +65,7 @@ TestFormatter_batch_comment(TestFormatter *self, const char *fmt, ...) {
 TestFormatterCF*
 TestFormatterCF_new() {
     TestFormatterCF *self
-        = (TestFormatterCF*)VTable_Make_Obj(TESTFORMATTERCF);
+        = (TestFormatterCF*)Class_Make_Obj(TESTFORMATTERCF);
     return TestFormatterCF_init(self);
 }
 
@@ -140,7 +140,7 @@ TestFormatterCF_Summary_IMP(TestFormatterCF *self, TestSuiteRunner *runner) {
 TestFormatterTAP*
 TestFormatterTAP_new() {
     TestFormatterTAP *self
-        = (TestFormatterTAP*)VTable_Make_Obj(TESTFORMATTERTAP);
+        = (TestFormatterTAP*)Class_Make_Obj(TESTFORMATTERTAP);
     return TestFormatterTAP_init(self);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/TestHarness/TestSuite.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/TestHarness/TestSuite.c b/runtime/core/Clownfish/TestHarness/TestSuite.c
index a396b16..d3d4b54 100644
--- a/runtime/core/Clownfish/TestHarness/TestSuite.c
+++ b/runtime/core/Clownfish/TestHarness/TestSuite.c
@@ -32,14 +32,14 @@
 #include "Clownfish/TestHarness/TestFormatter.h"
 #include "Clownfish/TestHarness/TestSuiteRunner.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 static void
 S_unbuffer_stdout();
 
 TestSuite*
 TestSuite_new() {
-    TestSuite *self = (TestSuite*)VTable_Make_Obj(TESTSUITE);
+    TestSuite *self = (TestSuite*)Class_Make_Obj(TESTSUITE);
     return TestSuite_init(self);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c b/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
index 64be5bd..20400b3 100644
--- a/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
+++ b/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
@@ -24,11 +24,11 @@
 #include "Clownfish/TestHarness/TestBatch.h"
 #include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/TestHarness/TestFormatter.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 TestSuiteRunner*
 TestSuiteRunner_new(TestFormatter *formatter) {
-    TestSuiteRunner *self = (TestSuiteRunner*)VTable_Make_Obj(TESTSUITERUNNER);
+    TestSuiteRunner *self = (TestSuiteRunner*)Class_Make_Obj(TESTSUITERUNNER);
     return TestSuiteRunner_init(self, formatter);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/VArray.c b/runtime/core/Clownfish/VArray.c
index e3d49d3..e7e667c 100644
--- a/runtime/core/Clownfish/VArray.c
+++ b/runtime/core/Clownfish/VArray.c
@@ -23,7 +23,7 @@
 
 #include "charmony.h"
 
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 #include "Clownfish/VArray.h"
 #include "Clownfish/Err.h"
 #include "Clownfish/Util/Memory.h"
@@ -31,7 +31,7 @@
 
 VArray*
 VA_new(uint32_t capacity) {
-    VArray *self = (VArray*)VTable_Make_Obj(VARRAY);
+    VArray *self = (VArray*)Class_Make_Obj(VARRAY);
     VA_init(self, capacity);
     return self;
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/VTable.c b/runtime/core/Clownfish/VTable.c
deleted file mode 100644
index fe6d718..0000000
--- a/runtime/core/Clownfish/VTable.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_VTABLE
-#define C_CFISH_OBJ
-#define C_CFISH_STRING
-#define C_CFISH_METHOD
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/String.h"
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Method.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/Util/Memory.h"
-
-size_t VTable_offset_of_parent = offsetof(VTable, parent);
-
-// Remove spaces and underscores, convert to lower case.
-static String*
-S_scrunch_string(String *source);
-
-static Method*
-S_find_method(VTable *self, const char *meth_name);
-
-static int32_t
-S_claim_parcel_id(void);
-
-LockFreeRegistry *VTable_registry = NULL;
-
-void
-VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
-{
-    int32_t parcel_id = S_claim_parcel_id();
-
-    /* Pass 1:
-     * - Initialize IVARS_OFFSET.
-     * - Allocate memory.
-     * - Initialize parent, flags, obj_alloc_size, vt_alloc_size.
-     * - Assign parcel_id.
-     * - Initialize method pointers.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *parent = spec->parent ? *spec->parent : NULL;
-
-        size_t ivars_offset = 0;
-        if (spec->ivars_offset_ptr != NULL) {
-            if (parent) {
-                VTable *ancestor = parent;
-                while (ancestor && ancestor->parcel_id == parcel_id) {
-                    ancestor = ancestor->parent;
-                }
-                ivars_offset = ancestor ? ancestor->obj_alloc_size : 0;
-                *spec->ivars_offset_ptr = ivars_offset;
-            }
-            else {
-                *spec->ivars_offset_ptr = 0;
-            }
-        }
-
-        size_t novel_offset = parent
-                              ? parent->vt_alloc_size
-                              : offsetof(VTable, method_ptrs);
-        size_t vt_alloc_size = novel_offset
-                               + spec->num_novel_meths
-                                 * sizeof(cfish_method_t);
-        VTable *vtable = (VTable*)Memory_wrapped_calloc(vt_alloc_size, 1);
-
-        vtable->parent         = parent;
-        vtable->parcel_id      = parcel_id;
-        vtable->flags          = 0;
-        vtable->obj_alloc_size = ivars_offset + spec->ivars_size;
-        vtable->vt_alloc_size  = vt_alloc_size;
-
-        if (parent) {
-            size_t parent_ptrs_size = parent->vt_alloc_size
-                                      - offsetof(VTable, method_ptrs);
-            memcpy(vtable->method_ptrs, parent->method_ptrs, parent_ptrs_size);
-        }
-
-        for (size_t i = 0; i < spec->num_inherited_meths; ++i) {
-            const InheritedMethSpec *mspec = &spec->inherited_meth_specs[i];
-            *mspec->offset = *mspec->parent_offset;
-        }
-
-        for (size_t i = 0; i < spec->num_overridden_meths; ++i) {
-            const OverriddenMethSpec *mspec = &spec->overridden_meth_specs[i];
-            *mspec->offset = *mspec->parent_offset;
-            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
-        }
-
-        for (size_t i = 0; i < spec->num_novel_meths; ++i) {
-            const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
-            *mspec->offset = novel_offset;
-            novel_offset += sizeof(cfish_method_t);
-            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
-        }
-
-        *spec->vtable = vtable;
-    }
-
-    /* Pass 2:
-     * - Initialize 'vtable' instance variable.
-     * - Initialize refcount.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *vtable = *spec->vtable;
-
-        VTable_Init_Obj_IMP(VTABLE, vtable);
-    }
-
-    /* Now it's safe to call methods.
-     *
-     * Pass 3:
-     * - Inititalize name and method array.
-     * - Register vtable.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *vtable = *spec->vtable;
-
-        vtable->name    = Str_newf("%s", spec->name);
-        vtable->methods = VA_new(0);
-
-        for (size_t i = 0; i < spec->num_novel_meths; ++i) {
-            const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
-            String *name = Str_newf("%s", mspec->name);
-            Method *method = Method_new(name, mspec->callback_func,
-                                        *mspec->offset);
-            VA_Push(vtable->methods, (Obj*)method);
-            DECREF(name);
-        }
-
-        VTable_add_to_registry(vtable);
-    }
-}
-
-void
-VTable_Destroy_IMP(VTable *self) {
-    THROW(ERR, "Insane attempt to destroy VTable for class '%o'", self->name);
-}
-
-VTable*
-VTable_Clone_IMP(VTable *self) {
-    VTable *twin
-        = (VTable*)Memory_wrapped_calloc(self->vt_alloc_size, 1);
-
-    memcpy(twin, self, self->vt_alloc_size);
-    VTable_Init_Obj(self->vtable, twin); // Set refcount.
-    twin->name = Str_Clone(self->name);
-
-    return twin;
-}
-
-Obj*
-VTable_Inc_RefCount_IMP(VTable *self) {
-    return (Obj*)self;
-}
-
-uint32_t
-VTable_Dec_RefCount_IMP(VTable *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-uint32_t
-VTable_Get_RefCount_IMP(VTable *self) {
-    UNUSED_VAR(self);
-    /* VTable_Get_RefCount() lies to other Clownfish code about the refcount
-     * because we don't want to have to synchronize access to the cached host
-     * object to which we have delegated responsibility for keeping refcounts.
-     * It always returns 1 because 1 is a positive number, and thus other
-     * Clownfish code will be fooled into believing it never needs to take
-     * action such as initiating a destructor.
-     *
-     * It's possible that the host has in fact increased the refcount of the
-     * cached host object if there are multiple refs to it on the other side
-     * of the Clownfish/host border, but returning 1 is good enough to fool
-     * Clownfish code.
-     */
-    return 1;
-}
-
-void
-VTable_Override_IMP(VTable *self, cfish_method_t method, size_t offset) {
-    union { char *char_ptr; cfish_method_t *func_ptr; } pointer;
-    pointer.char_ptr = ((char*)self) + offset;
-    pointer.func_ptr[0] = method;
-}
-
-String*
-VTable_Get_Name_IMP(VTable *self) {
-    return self->name;
-}
-
-VTable*
-VTable_Get_Parent_IMP(VTable *self) {
-    return self->parent;
-}
-
-size_t
-VTable_Get_Obj_Alloc_Size_IMP(VTable *self) {
-    return self->obj_alloc_size;
-}
-
-VArray*
-VTable_Get_Methods_IMP(VTable *self) {
-    return self->methods;
-}
-
-void
-VTable_init_registry() {
-    LockFreeRegistry *reg = LFReg_new(256);
-    if (Atomic_cas_ptr((void*volatile*)&VTable_registry, NULL, reg)) {
-        return;
-    }
-    else {
-        DECREF(reg);
-    }
-}
-
-VTable*
-VTable_singleton(String *class_name, VTable *parent) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-
-    VTable *singleton = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-    if (singleton == NULL) {
-        VArray *fresh_host_methods;
-        uint32_t num_fresh;
-
-        if (parent == NULL) {
-            String *parent_class = VTable_find_parent_class(class_name);
-            if (parent_class == NULL) {
-                THROW(ERR, "Class '%o' doesn't descend from %o", class_name,
-                      OBJ->name);
-            }
-            else {
-                parent = VTable_singleton(parent_class, NULL);
-                DECREF(parent_class);
-            }
-        }
-
-        // Copy source vtable.
-        singleton = VTable_Clone(parent);
-
-        // Turn clone into child.
-        singleton->parent = parent;
-        DECREF(singleton->name);
-        singleton->name = Str_Clone(class_name);
-
-        // Allow host methods to override.
-        fresh_host_methods = VTable_fresh_host_methods(class_name);
-        num_fresh = VA_Get_Size(fresh_host_methods);
-        if (num_fresh) {
-            Hash *meths = Hash_new(num_fresh);
-            for (uint32_t i = 0; i < num_fresh; i++) {
-                String *meth = (String*)VA_Fetch(fresh_host_methods, i);
-                String *scrunched = S_scrunch_string(meth);
-                Hash_Store(meths, (Obj*)scrunched, (Obj*)CFISH_TRUE);
-                DECREF(scrunched);
-            }
-            for (VTable *vtable = parent; vtable; vtable = vtable->parent) {
-                uint32_t max = VA_Get_Size(vtable->methods);
-                for (uint32_t i = 0; i < max; i++) {
-                    Method *method = (Method*)VA_Fetch(vtable->methods, i);
-                    if (method->callback_func) {
-                        String *scrunched = S_scrunch_string(method->name);
-                        if (Hash_Fetch(meths, (Obj*)scrunched)) {
-                            VTable_Override(singleton, method->callback_func,
-                                            method->offset);
-                        }
-                        DECREF(scrunched);
-                    }
-                }
-            }
-            DECREF(meths);
-        }
-        DECREF(fresh_host_methods);
-
-        // Register the new class, both locally and with host.
-        if (VTable_add_to_registry(singleton)) {
-            // Doing this after registering is racy, but hard to fix. :(
-            VTable_register_with_host(singleton, parent);
-        }
-        else {
-            DECREF(singleton);
-            singleton = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-            if (!singleton) {
-                THROW(ERR, "Failed to either insert or fetch VTable for '%o'",
-                      class_name);
-            }
-        }
-    }
-
-    return singleton;
-}
-
-static String*
-S_scrunch_string(String *source) {
-    CharBuf *buf = CB_new(Str_Get_Size(source));
-    StringIterator *iter = Str_Top(source);
-    int32_t code_point;
-    while (STRITER_DONE != (code_point = StrIter_Next(iter))) {
-        if (code_point > 127) {
-            THROW(ERR, "Can't fold case for %o", source);
-        }
-        else if (code_point != '_') {
-            CB_Cat_Char(buf, tolower(code_point));
-        }
-    }
-    String *retval = CB_Yield_String(buf);
-    DECREF(iter);
-    DECREF(buf);
-    return retval;
-}
-
-bool
-VTable_add_to_registry(VTable *vtable) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-    if (LFReg_Fetch(VTable_registry, (Obj*)vtable->name)) {
-        return false;
-    }
-    else {
-        String *klass = Str_Clone(vtable->name);
-        bool retval
-            = LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable);
-        DECREF(klass);
-        return retval;
-    }
-}
-
-bool
-VTable_add_alias_to_registry(VTable *vtable, const char *alias_ptr,
-                             size_t alias_len) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-    StackString *alias = SSTR_WRAP_UTF8(alias_ptr, alias_len);
-    if (LFReg_Fetch(VTable_registry, (Obj*)alias)) {
-        return false;
-    }
-    else {
-        String *klass = SStr_Clone(alias);
-        bool retval
-            = LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable);
-        DECREF(klass);
-        return retval;
-    }
-}
-
-VTable*
-VTable_fetch_vtable(String *class_name) {
-    VTable *vtable = NULL;
-    if (VTable_registry != NULL) {
-        vtable = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-    }
-    return vtable;
-}
-
-void
-VTable_Add_Host_Method_Alias_IMP(VTable *self, const char *alias,
-                             const char *meth_name) {
-    Method *method = S_find_method(self, meth_name);
-    if (!method) {
-        fprintf(stderr, "Method %s not found\n", meth_name);
-        abort();
-    }
-    method->host_alias = Str_newf("%s", alias);
-}
-
-void
-VTable_Exclude_Host_Method_IMP(VTable *self, const char *meth_name) {
-    Method *method = S_find_method(self, meth_name);
-    if (!method) {
-        fprintf(stderr, "Method %s not found\n", meth_name);
-        abort();
-    }
-    method->is_excluded = true;
-}
-
-static Method*
-S_find_method(VTable *self, const char *name) {
-    size_t   name_len = strlen(name);
-    uint32_t size     = VA_Get_Size(self->methods);
-
-    for (uint32_t i = 0; i < size; i++) {
-        Method *method = (Method*)VA_Fetch(self->methods, i);
-        if (Str_Equals_Utf8(method->name, name, name_len)) {
-            return method;
-        }
-    }
-
-    return NULL;
-}
-
-static size_t parcel_count;
-
-static int32_t
-S_claim_parcel_id(void) {
-    // TODO: use ordinary cas rather than cas_ptr.
-    union { size_t num; void *ptr; } old_value;
-    union { size_t num; void *ptr; } new_value;
-
-    bool succeeded = false;
-    do {
-        old_value.num = parcel_count;
-        new_value.num = old_value.num + 1;
-        succeeded = Atomic_cas_ptr((void*volatile*)&parcel_count,
-                                   old_value.ptr, new_value.ptr);
-    } while (!succeeded);
-
-    return new_value.num;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/core/Clownfish/VTable.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/VTable.cfh b/runtime/core/Clownfish/VTable.cfh
deleted file mode 100644
index 97e5cf6..0000000
--- a/runtime/core/Clownfish/VTable.cfh
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Virtual method dispatch table.
- *
- * VTables, which are the first element in any Clownfish object, are actually
- * objects themselves.  (Their first element is a VTable which describes the
- * behavior of VTables.)
- */
-
-class Clownfish::VTable inherits Clownfish::Obj {
-
-    VTable            *parent;
-    String            *name;
-    uint32_t           flags;
-    int32_t            parcel_id;
-    size_t             obj_alloc_size;
-    size_t             vt_alloc_size;
-    VArray            *methods;
-    cfish_method_t[1]  method_ptrs; /* flexible array */
-
-    inert LockFreeRegistry *registry;
-    inert size_t offset_of_parent;
-
-    inert void
-    bootstrap(const cfish_VTableSpec *specs, size_t num_specs);
-
-    /** Return a singleton.  If a VTable can be found in the registry based on
-     * the supplied class name, it will be returned.  Otherwise, a new VTable
-     * will be created using [parent] as a base.
-     *
-     * If [parent] is NULL, an attempt will be made to find it using
-     * VTable_find_parent_class().  If the attempt fails, an error will
-     * result.
-     */
-    inert VTable*
-    singleton(String *class_name, VTable *parent);
-
-    /** Register a vtable, so that it can be retrieved by class name.
-     *
-     * TODO: Move this functionality to some kind of class loader.
-     *
-     * @return true on success, false if the class was already registered.
-     */
-    inert bool
-    add_to_registry(VTable *vtable);
-
-    inert bool
-    add_alias_to_registry(VTable *vtable, const char *alias_ptr,
-                          size_t alias_len);
-
-    /** Initialize the registry.
-     */
-    inert void
-    init_registry();
-
-    /** Tell the host about the new class.
-     */
-    inert void
-    register_with_host(VTable *vtable, VTable *parent);
-
-    /** Find a registered class and return its vtable.  May return NULL if the
-     * class is not registered.
-     */
-    inert nullable VTable*
-    fetch_vtable(String *class_name);
-
-    /** Given a class name, return the name of a parent class which descends
-     * from Clownfish::Obj, or NULL if such a class can't be found.
-     */
-    inert nullable String*
-    find_parent_class(String *class_name);
-
-    /** List all of the methods defined directly within a host subclass.
-     */
-    inert incremented VArray*
-    fresh_host_methods(String *class_name);
-
-    /** Replace a function pointer in the VTable.
-     */
-    void
-    Override(VTable *self, cfish_method_t method_ptr, size_t offset);
-
-    /** Create an empty object of the type defined by the VTable: allocate,
-     * assign its vtable and give it an initial refcount of 1.  The caller is
-     * responsible for initialization.
-     */
-    Obj*
-    Make_Obj(VTable *self);
-
-    /** Take a raw memory allocation which is presumed to be of adequate size,
-     * assign its vtable and give it an initial refcount of 1.
-     */
-    Obj*
-    Init_Obj(VTable *self, void *allocation);
-
-    /** Create a new object to go with the supplied host object.
-     */
-    Obj*
-    Foster_Obj(VTable *self, void *host_obj);
-
-    void
-    Add_Host_Method_Alias(VTable *self, const char *alias,
-                          const char *meth_name);
-
-    void
-    Exclude_Host_Method(VTable *self, const char *meth_name);
-
-    String*
-    Get_Name(VTable *self);
-
-    VTable*
-    Get_Parent(VTable *self);
-
-    size_t
-    Get_Obj_Alloc_Size(VTable *self);
-
-    VArray*
-    Get_Methods(VTable *self);
-
-    public incremented VTable*
-    Clone(VTable *self);
-
-    incremented Obj*
-    Inc_RefCount(VTable *self);
-
-    uint32_t
-    Dec_RefCount(VTable *self);
-
-    uint32_t
-    Get_RefCount(VTable *self);
-
-    void*
-    To_Host(VTable *self);
-
-    public void
-    Destroy(VTable *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build/Binding.pm b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index d61718d..7593d32 100644
--- a/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -31,7 +31,7 @@ sub bind_all {
     $class->bind_float64;
     $class->bind_obj;
     $class->bind_varray;
-    $class->bind_vtable;
+    $class->bind_class;
     $class->bind_stringhelper;
 }
 
@@ -457,7 +457,7 @@ is_a(self, class_name)
     cfish_String *class_name;
 CODE:
 {
-    cfish_VTable *target = cfish_VTable_fetch_vtable(class_name);
+    cfish_Class *target = cfish_Class_fetch_class(class_name);
     RETVAL = CFISH_Obj_Is_A(self, target);
 }
 OUTPUT: RETVAL
@@ -553,23 +553,23 @@ END_XS_CODE
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
-sub bind_vtable {
+sub bind_class {
     my @hand_rolled = qw( Make_Obj );
 
     my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::VTable
+MODULE = Clownfish   PACKAGE = Clownfish::Class
 
 SV*
 _get_registry()
 CODE:
-    if (cfish_VTable_registry == NULL) {
-        cfish_VTable_init_registry();
+    if (cfish_Class_registry == NULL) {
+        cfish_Class_init_registry();
     }
-    RETVAL = (SV*)CFISH_Obj_To_Host((cfish_Obj*)cfish_VTable_registry);
+    RETVAL = (SV*)CFISH_Obj_To_Host((cfish_Obj*)cfish_Class_registry);
 OUTPUT: RETVAL
 
 SV*
-fetch_vtable(unused_sv, class_name_sv)
+fetch_class(unused_sv, class_name_sv)
     SV *unused_sv;
     SV *class_name_sv;
 CODE:
@@ -578,9 +578,9 @@ CODE:
     STRLEN size;
     char *ptr = SvPVutf8(class_name_sv, size);
     cfish_StackString *class_name = CFISH_SSTR_WRAP_UTF8(ptr, size);
-    cfish_VTable *vtable
-        = cfish_VTable_fetch_vtable((cfish_String*)class_name);
-    RETVAL = vtable ? (SV*)CFISH_VTable_To_Host(vtable) : &PL_sv_undef;
+    cfish_Class *klass
+        = cfish_Class_fetch_class((cfish_String*)class_name);
+    RETVAL = klass ? (SV*)CFISH_Class_To_Host(klass) : &PL_sv_undef;
 }
 OUTPUT: RETVAL
 
@@ -591,34 +591,34 @@ CODE:
 {
     CFISH_UNUSED_VAR(unused_sv);
     cfish_String *class_name = NULL;
-    cfish_VTable *parent     = NULL;
+    cfish_Class  *parent     = NULL;
     bool args_ok
         = XSBind_allot_params(&(ST(0)), 1, items,
                               ALLOT_OBJ(&class_name, "class_name", 10, true,
                                         CFISH_STRING, alloca(cfish_SStr_size())),
                               ALLOT_OBJ(&parent, "parent", 6, false,
-                                        CFISH_VTABLE, NULL),
+                                        CFISH_CLASS, NULL),
                               NULL);
     if (!args_ok) {
         CFISH_RETHROW(CFISH_INCREF(cfish_Err_get_error()));
     }
-    cfish_VTable *singleton = cfish_VTable_singleton(class_name, parent);
-    RETVAL = (SV*)CFISH_VTable_To_Host(singleton);
+    cfish_Class *singleton = cfish_Class_singleton(class_name, parent);
+    RETVAL = (SV*)CFISH_Class_To_Host(singleton);
 }
 OUTPUT: RETVAL
 
 SV*
 make_obj(self)
-    cfish_VTable *self;
+    cfish_Class *self;
 CODE:
-    cfish_Obj *blank = CFISH_VTable_Make_Obj(self);
+    cfish_Obj *blank = CFISH_Class_Make_Obj(self);
     RETVAL = CFISH_OBJ_TO_SV_NOINC(blank);
 OUTPUT: RETVAL
 END_XS_CODE
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Clownfish",
-        class_name => "Clownfish::VTable",
+        class_name => "Clownfish::Class",
     );
     $binding->exclude_method($_) for @hand_rolled;
     $binding->append_xs($xs_code);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index d683245..5b02103 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -89,7 +89,7 @@ sub error {$Clownfish::Err::error}
 }
 
 {
-    package Clownfish::VTable;
+    package Clownfish::Class;
     our $VERSION = '0.003000';
     $VERSION = eval $VERSION;
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/lib/Clownfish.pod
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pod b/runtime/perl/lib/Clownfish.pod
index 456ff59..cfb3c79 100644
--- a/runtime/perl/lib/Clownfish.pod
+++ b/runtime/perl/lib/Clownfish.pod
@@ -209,7 +209,7 @@ file.
 
 For every class, a global variable with the uppercase name
 C<{PARCEL_NICK}_{CLASS_LAST_COMP}> is defined. This variable is a pointer to
-a Clownfish::VTable object which is initialized when bootstrapping the parcel.
+a Clownfish::Class object which is initialized when bootstrapping the parcel.
 
 Example of a class declaration:
 
@@ -226,7 +226,7 @@ This will generate:
         /* Instance variables */
     };
     typedef struct pfind_VisibilityGraph pfind_VisibilityGraph;
-    extern cfish_VTable *PFIND_VISIBILITYGRAPH;
+    extern cfish_Class *PFIND_VISIBILITYGRAPH;
 
 =head3 Class exposure
 
@@ -431,7 +431,7 @@ implementation will look like:
 
 Clownfish defines a macro named C<CFISH_METHOD_PTR> that looks up the pointer
 to the implementing function of a method. The first parameter of the macro is
-a pointer to the Clownfish::VTable object of the method's class, the second is
+a pointer to the Clownfish::Class object of the method's class, the second is
 the unshortened name of the method wrapper. If short names for the Clownfish
 parcel are used, the macro is also available under the name C<METHOD_PTR>.
 
@@ -512,7 +512,7 @@ Example:
 =head3 Object creation
 
 Objects are allocated by invoking the C<Make_Obj> method on a class's
-Clownfish::VTable object.
+Clownfish::Class object.
 
 Any inert function can be used to construct objects from C. But to support
 inheritance and object creation from the host language, Clownfish classes
@@ -550,7 +550,7 @@ Example:
 
     Train*
     Train_new(double max_speed, double track_gauge) {
-        Train *self = (Train*)VTable_Make_Obj(TRAIN);
+        Train *self = (Train*)Class_Make_Obj(TRAIN);
         return Train_init(self, max_speed, track_gauge);
     }
 
@@ -586,7 +586,7 @@ This public method takes no arguments besides C<self> and has no return value.
 It should release the resources held by the object and finally call the
 C<Destroy> method of the superclass via the C<CFISH_SUPER_DESTROY> macro with
 short name C<SUPER_DESTROY>. This macro takes the C<self> pointer as first
-argument and a pointer to the object's Clownfish::VTable as second argument.
+argument and a pointer to the object's Clownfish::Class as second argument.
 The C<Destroy> method of the Clownfish::Obj class will eventually free the
 object struct.
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/lib/Clownfish/Class.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish/Class.pm b/runtime/perl/lib/Clownfish/Class.pm
new file mode 100644
index 0000000..ed4b538
--- /dev/null
+++ b/runtime/perl/lib/Clownfish/Class.pm
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+package Clownfish::Class;
+use Clownfish;
+our $VERSION = '0.003000';
+$VERSION = eval $VERSION;
+
+1;
+
+__END__
+
+

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/lib/Clownfish/VTable.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish/VTable.pm b/runtime/perl/lib/Clownfish/VTable.pm
deleted file mode 100644
index b5f5eb5..0000000
--- a/runtime/perl/lib/Clownfish/VTable.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::VTable;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/t/021-class.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/021-class.t b/runtime/perl/t/021-class.t
new file mode 100644
index 0000000..61feec2
--- /dev/null
+++ b/runtime/perl/t/021-class.t
@@ -0,0 +1,57 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+use strict;
+use warnings;
+
+package MyHash;
+use base qw( Clownfish::Hash );
+
+sub oodle { }
+
+package main;
+
+use Test::More tests => 5;
+
+my $stringified;
+my $storage = Clownfish::Hash->new;
+
+{
+    my $subclassed_hash = MyHash->new;
+    $stringified = $subclassed_hash->to_string;
+
+    isa_ok( $subclassed_hash, "MyHash", "Perl isa reports correct subclass" );
+
+   # Store the subclassed object.  At the end of this block, the Perl object
+   # will go out of scope and DESTROY will be called, but the Clownfish object
+   # will persist.
+    $storage->store( "test", $subclassed_hash );
+}
+
+my $resurrected = $storage->_fetch("test");
+
+isa_ok( $resurrected, "MyHash", "subclass name survived Perl destruction" );
+is( $resurrected->to_string, $stringified,
+    "It's the same Hash from earlier (though a different Perl object)" );
+
+my $booga = Clownfish::String->new("booga");
+$resurrected->store( "ooga", $booga );
+
+is( $resurrected->fetch("ooga"),
+    "booga", "subclassed object still performs correctly at the C level" );
+
+my $methods = Clownfish::Class::_fresh_host_methods('MyHash');
+is_deeply( $methods->to_perl, ['oodle'], "fresh_host_methods" );
+

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/t/021-vtable.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/021-vtable.t b/runtime/perl/t/021-vtable.t
deleted file mode 100644
index d2e0c14..0000000
--- a/runtime/perl/t/021-vtable.t
+++ /dev/null
@@ -1,57 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package MyHash;
-use base qw( Clownfish::Hash );
-
-sub oodle { }
-
-package main;
-
-use Test::More tests => 5;
-
-my $stringified;
-my $storage = Clownfish::Hash->new;
-
-{
-    my $subclassed_hash = MyHash->new;
-    $stringified = $subclassed_hash->to_string;
-
-    isa_ok( $subclassed_hash, "MyHash", "Perl isa reports correct subclass" );
-
-   # Store the subclassed object.  At the end of this block, the Perl object
-   # will go out of scope and DESTROY will be called, but the Clownfish object
-   # will persist.
-    $storage->store( "test", $subclassed_hash );
-}
-
-my $resurrected = $storage->_fetch("test");
-
-isa_ok( $resurrected, "MyHash", "subclass name survived Perl destruction" );
-is( $resurrected->to_string, $stringified,
-    "It's the same Hash from earlier (though a different Perl object)" );
-
-my $booga = Clownfish::String->new("booga");
-$resurrected->store( "ooga", $booga );
-
-is( $resurrected->fetch("ooga"),
-    "booga", "subclassed object still performs correctly at the C level" );
-
-my $methods = Clownfish::VTable::_fresh_host_methods('MyHash');
-is_deeply( $methods->to_perl, ['oodle'], "fresh_host_methods" );
-

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.c b/runtime/perl/xs/XSBind.c
index 4c7a275..9f45d14 100644
--- a/runtime/perl/xs/XSBind.c
+++ b/runtime/perl/xs/XSBind.c
@@ -15,7 +15,7 @@
  */
 
 #define C_CFISH_OBJ
-#define C_CFISH_VTABLE
+#define C_CFISH_CLASS
 #define C_CFISH_LOCKFREEREGISTRY
 #define NEED_newRV_noinc
 #include "charmony.h"
@@ -49,55 +49,55 @@ S_cfish_hash_to_perl_hash(cfish_Hash *hash);
 
 cfish_Obj*
 XSBind_new_blank_obj(SV *either_sv) {
-    cfish_VTable *vtable;
+    cfish_Class *klass;
 
-    // Get a VTable.
+    // Get a Class.
     if (sv_isobject(either_sv)
         && sv_derived_from(either_sv, "Clownfish::Obj")
        ) {
-        // Use the supplied object's VTable.
+        // Use the supplied object's Class.
         IV iv_ptr = SvIV(SvRV(either_sv));
         cfish_Obj *self = INT2PTR(cfish_Obj*, iv_ptr);
-        vtable = self->vtable;
+        klass = self->klass;
     }
     else {
-        // Use the supplied class name string to find a VTable.
+        // Use the supplied class name string to find a Class.
         STRLEN len;
         char *ptr = SvPVutf8(either_sv, len);
-        cfish_StackString *klass = CFISH_SSTR_WRAP_UTF8(ptr, len);
-        vtable = cfish_VTable_singleton((cfish_String*)klass, NULL);
+        cfish_StackString *class_name = CFISH_SSTR_WRAP_UTF8(ptr, len);
+        klass = cfish_Class_singleton((cfish_String*)class_name, NULL);
     }
 
-    // Use the VTable to allocate a new blank object of the right size.
-    return CFISH_VTable_Make_Obj(vtable);
+    // Use the Class to allocate a new blank object of the right size.
+    return CFISH_Class_Make_Obj(klass);
 }
 
 cfish_Obj*
-XSBind_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation) {
-    cfish_Obj *retval = XSBind_maybe_sv_to_cfish_obj(sv, vtable, allocation);
+XSBind_sv_to_cfish_obj(SV *sv, cfish_Class *klass, void *allocation) {
+    cfish_Obj *retval = XSBind_maybe_sv_to_cfish_obj(sv, klass, allocation);
     if (!retval) {
-        THROW(CFISH_ERR, "Not a %o", CFISH_VTable_Get_Name(vtable));
+        THROW(CFISH_ERR, "Not a %o", CFISH_Class_Get_Name(klass));
     }
     return retval;
 }
 
 cfish_Obj*
-XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation) {
+XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_Class *klass, void *allocation) {
     cfish_Obj *retval = NULL;
     if (XSBind_sv_defined(sv)) {
         // Assume that the class name is always NULL-terminated. Somewhat
         // dangerous but should be safe.
         if (sv_isobject(sv)
-            && sv_derived_from(sv, CFISH_Str_Get_Ptr8(CFISH_VTable_Get_Name(vtable)))
+            && sv_derived_from(sv, CFISH_Str_Get_Ptr8(CFISH_Class_Get_Name(klass)))
            ) {
             // Unwrap a real Clownfish object.
             IV tmp = SvIV(SvRV(sv));
             retval = INT2PTR(cfish_Obj*, tmp);
         }
         else if (allocation &&
-                 (vtable == CFISH_STACKSTRING
-                  || vtable == CFISH_STRING
-                  || vtable == CFISH_OBJ)
+                 (klass == CFISH_STACKSTRING
+                  || klass == CFISH_STRING
+                  || klass == CFISH_OBJ)
                 ) {
             // Wrap the string from an ordinary Perl scalar inside a
             // StackString.
@@ -109,10 +109,10 @@ XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation) {
             // Attempt to convert Perl hashes and arrays into their Clownfish
             // analogues.
             SV *inner = SvRV(sv);
-            if (SvTYPE(inner) == SVt_PVAV && vtable == CFISH_VARRAY) {
+            if (SvTYPE(inner) == SVt_PVAV && klass == CFISH_VARRAY) {
                 retval = (cfish_Obj*)S_perl_array_to_cfish_array((AV*)inner);
             }
-            else if (SvTYPE(inner) == SVt_PVHV && vtable == CFISH_HASH) {
+            else if (SvTYPE(inner) == SVt_PVHV && klass == CFISH_HASH) {
                 retval = (cfish_Obj*)S_perl_hash_to_cfish_hash((HV*)inner);
             }
 
@@ -396,7 +396,7 @@ XSBind_enable_overload(void *pobj) {
 
 static bool
 S_extract_from_sv(SV *value, void *target, const char *label,
-                  bool required, int type, cfish_VTable *vtable,
+                  bool required, int type, cfish_Class *klass,
                   void *allocation) {
     bool valid_assignment = false;
 
@@ -460,7 +460,7 @@ S_extract_from_sv(SV *value, void *target, const char *label,
                 break;
             case XSBIND_WANT_OBJ: {
                     cfish_Obj *object
-                        = XSBind_maybe_sv_to_cfish_obj(value, vtable,
+                        = XSBind_maybe_sv_to_cfish_obj(value, klass,
                                                        allocation);
                     if (object) {
                         *((cfish_Obj**)target) = object;
@@ -470,7 +470,7 @@ S_extract_from_sv(SV *value, void *target, const char *label,
                         cfish_String *mess
                             = CFISH_MAKE_MESS(
                                   "Invalid value for '%s' - not a %o",
-                                  label, CFISH_VTable_Get_Name(vtable));
+                                  label, CFISH_Class_Get_Name(klass));
                         cfish_Err_set_error(cfish_Err_new(mess));
                         return false;
                     }
@@ -526,7 +526,7 @@ XSBind_allot_params(SV** stack, int32_t start, int32_t num_stack_elems, ...) {
         int   label_len = va_arg(args, int);
         int   required  = va_arg(args, int);
         int   type      = va_arg(args, int);
-        cfish_VTable *vtable = va_arg(args, cfish_VTable*);
+        cfish_Class *klass = va_arg(args, cfish_Class*);
         void *allocation = va_arg(args, void*);
 
         // Iterate through the stack looking for labels which match this param
@@ -558,7 +558,7 @@ XSBind_allot_params(SV** stack, int32_t start, int32_t num_stack_elems, ...) {
             // Found the arg.  Extract the value.
             SV *value = stack[found_arg + 1];
             bool got_arg = S_extract_from_sv(value, target, label,
-                                                   required, type, vtable,
+                                                   required, type, klass,
                                                    allocation);
             if (!got_arg) {
                 CFISH_ERR_ADD_FRAME(cfish_Err_get_error());
@@ -601,7 +601,7 @@ S_lazy_init_host_obj(cfish_Obj *self) {
     sv_setiv(inner_obj, PTR2IV(self));
 
     // Connect class association.
-    cfish_String *class_name = CFISH_VTable_Get_Name(self->vtable);
+    cfish_String *class_name = CFISH_Class_Get_Name(self->klass);
     HV *stash = gv_stashpvn(CFISH_Str_Get_Ptr8(class_name),
                             CFISH_Str_Get_Size(class_name), TRUE);
     SvSTASH_set(inner_obj, (HV*)SvREFCNT_inc(stash));
@@ -669,53 +669,53 @@ CFISH_Obj_To_Host_IMP(cfish_Obj *self) {
     return newRV_inc((SV*)self->ref.host_obj);
 }
 
-/*************************** Clownfish::VTable ******************************/
+/*************************** Clownfish::Class ******************************/
 
 cfish_Obj*
-CFISH_VTable_Make_Obj_IMP(cfish_VTable *self) {
+CFISH_Class_Make_Obj_IMP(cfish_Class *self) {
     cfish_Obj *obj
         = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
-    obj->vtable = self;
+    obj->klass = self;
     obj->ref.count = (1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG;
     return obj;
 }
 
 cfish_Obj*
-CFISH_VTable_Init_Obj_IMP(cfish_VTable *self, void *allocation) {
+CFISH_Class_Init_Obj_IMP(cfish_Class *self, void *allocation) {
     cfish_Obj *obj = (cfish_Obj*)allocation;
-    obj->vtable = self;
+    obj->klass = self;
     obj->ref.count = (1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG;
     return obj;
 }
 
 cfish_Obj*
-CFISH_VTable_Foster_Obj_IMP(cfish_VTable *self, void *host_obj) {
+CFISH_Class_Foster_Obj_IMP(cfish_Class *self, void *host_obj) {
     cfish_Obj *obj
         = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
     SV *inner_obj = SvRV((SV*)host_obj);
-    obj->vtable = self;
+    obj->klass = self;
     sv_setiv(inner_obj, PTR2IV(obj));
     obj->ref.host_obj = inner_obj;
     return obj;
 }
 
 void
-cfish_VTable_register_with_host(cfish_VTable *singleton, cfish_VTable *parent) {
+cfish_Class_register_with_host(cfish_Class *singleton, cfish_Class *parent) {
     dSP;
     ENTER;
     SAVETMPS;
     EXTEND(SP, 2);
     PUSHMARK(SP);
-    mPUSHs((SV*)CFISH_VTable_To_Host(singleton));
-    mPUSHs((SV*)CFISH_VTable_To_Host(parent));
+    mPUSHs((SV*)CFISH_Class_To_Host(singleton));
+    mPUSHs((SV*)CFISH_Class_To_Host(parent));
     PUTBACK;
-    call_pv("Clownfish::VTable::_register", G_VOID | G_DISCARD);
+    call_pv("Clownfish::Class::_register", G_VOID | G_DISCARD);
     FREETMPS;
     LEAVE;
 }
 
 cfish_VArray*
-cfish_VTable_fresh_host_methods(cfish_String *class_name) {
+cfish_Class_fresh_host_methods(cfish_String *class_name) {
     dSP;
     ENTER;
     SAVETMPS;
@@ -723,7 +723,7 @@ cfish_VTable_fresh_host_methods(cfish_String *class_name) {
     PUSHMARK(SP);
     mPUSHs(XSBind_str_to_sv(class_name));
     PUTBACK;
-    call_pv("Clownfish::VTable::_fresh_host_methods", G_SCALAR);
+    call_pv("Clownfish::Class::_fresh_host_methods", G_SCALAR);
     SPAGAIN;
     cfish_VArray *methods = (cfish_VArray*)XSBind_perl_to_cfish(POPs);
     PUTBACK;
@@ -733,7 +733,7 @@ cfish_VTable_fresh_host_methods(cfish_String *class_name) {
 }
 
 cfish_String*
-cfish_VTable_find_parent_class(cfish_String *class_name) {
+cfish_Class_find_parent_class(cfish_String *class_name) {
     dSP;
     ENTER;
     SAVETMPS;
@@ -741,7 +741,7 @@ cfish_VTable_find_parent_class(cfish_String *class_name) {
     PUSHMARK(SP);
     mPUSHs(XSBind_str_to_sv(class_name));
     PUTBACK;
-    call_pv("Clownfish::VTable::_find_parent_class", G_SCALAR);
+    call_pv("Clownfish::Class::_find_parent_class", G_SCALAR);
     SPAGAIN;
     SV *parent_class_sv = POPs;
     PUTBACK;
@@ -753,10 +753,10 @@ cfish_VTable_find_parent_class(cfish_String *class_name) {
 }
 
 void*
-CFISH_VTable_To_Host_IMP(cfish_VTable *self) {
+CFISH_Class_To_Host_IMP(cfish_Class *self) {
     bool first_time = self->ref.count & XSBIND_REFCOUNT_FLAG ? true : false;
-    CFISH_VTable_To_Host_t to_host
-        = CFISH_SUPER_METHOD_PTR(CFISH_VTABLE, CFISH_VTable_To_Host);
+    CFISH_Class_To_Host_t to_host
+        = CFISH_SUPER_METHOD_PTR(CFISH_CLASS, CFISH_Class_To_Host);
     SV *host_obj = (SV*)to_host(self);
     if (first_time) {
         SvSHARE((SV*)self->ref.host_obj);
@@ -853,8 +853,8 @@ CFISH_Err_To_Host_IMP(cfish_Err *self) {
 }
 
 void
-cfish_Err_throw_mess(cfish_VTable *vtable, cfish_String *message) {
-    CHY_UNUSED_VAR(vtable);
+cfish_Err_throw_mess(cfish_Class *klass, cfish_String *message) {
+    CHY_UNUSED_VAR(klass);
     cfish_Err *err = cfish_Err_new(message);
     cfish_Err_do_throw(err);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.h b/runtime/perl/xs/XSBind.h
index 5df36f9..73b5ebb 100644
--- a/runtime/perl/xs/XSBind.h
+++ b/runtime/perl/xs/XSBind.h
@@ -27,7 +27,7 @@
 #include "Clownfish/Hash.h"
 #include "Clownfish/Num.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 /* Avoid conflicts with Clownfish bool type. */
 #define HAS_BOOL
@@ -59,20 +59,20 @@ cfish_XSBind_sv_defined(SV *sv) {
 }
 
 /** If the SV contains a Clownfish object which passes an "isa" test against the
- * passed-in VTable, return a pointer to it.  If not, but
+ * passed-in Class, return a pointer to it.  If not, but
  * <code>allocation</code> is non-NULL and a StackString would satisfy the
  * "isa" test, stringify the SV, create a StackString using
  * <code>allocation</code>, assign the SV's string to it, and return that
  * instead.  If all else fails, throw an exception.
  */
 CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation);
+cfish_XSBind_sv_to_cfish_obj(SV *sv, cfish_Class *klass, void *allocation);
 
 /** As XSBind_sv_to_cfish_obj above, but returns NULL instead of throwing an
  * exception.
  */
 CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable,
+cfish_XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_Class *klass,
                                    void *allocation);
 
 
@@ -187,9 +187,9 @@ cfish_XSBind_enable_overload(void *pobj);
  *
  * Use the following macro if a Clownfish object is desired:
  *
- *     ALLOT_OBJ(ptr, key, keylen, required, vtable, allocation)
+ *     ALLOT_OBJ(ptr, key, keylen, required, klass, allocation)
  *
- * The "vtable" argument must be the VTable corresponding to the class of the
+ * The "klass" argument must be the Class corresponding to the class of the
  * desired object.  The "allocation" argument must be a blob of memory
  * allocated on the stack sufficient to hold a StackString.  (Use
  * cfish_SStr_size() to find the allocation size.)
@@ -295,8 +295,8 @@ cfish_XSBind_allot_params(SV** stack, int32_t start,
     ptr, key, keylen, required, XSBIND_WANT_F32, NULL, NULL
 #define XSBIND_ALLOT_F64(ptr, key, keylen, required) \
     ptr, key, keylen, required, XSBIND_WANT_F64, NULL, NULL
-#define XSBIND_ALLOT_OBJ(ptr, key, keylen, required, vtable, allocation) \
-    ptr, key, keylen, required, XSBIND_WANT_OBJ, vtable, allocation
+#define XSBIND_ALLOT_OBJ(ptr, key, keylen, required, klass, allocation) \
+    ptr, key, keylen, required, XSBIND_WANT_OBJ, klass, allocation
 #define XSBIND_ALLOT_SV(ptr, key, keylen, required) \
     ptr, key, keylen, required, XSBIND_WANT_SV, NULL, NULL
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0c8e0f14/runtime/ruby/ext/Bind.h
----------------------------------------------------------------------
diff --git a/runtime/ruby/ext/Bind.h b/runtime/ruby/ext/Bind.h
index 805afae..12a5ba3 100644
--- a/runtime/ruby/ext/Bind.h
+++ b/runtime/ruby/ext/Bind.h
@@ -32,7 +32,7 @@ extern "C" {
 #include "Clownfish/Hash.h"
 #include "Clownfish/Num.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
+#include "Clownfish/Class.h"
 
 VALUE Bind_cfish_to_ruby(cfish_Obj *obj);
 VALUE Bind_str_to_ruby(cfish_String *str);


Mime
View raw message