lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [09/14] lucy git commit: Rename VArray to Vector
Date Wed, 29 Apr 2015 19:56:30 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/QueryParser.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index 69bcfdb..4dc496d 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -54,58 +54,58 @@
 
 // Helper function for Tree().
 static Query*
-S_parse_subquery(QueryParser *self, VArray *elems, String *default_field,
+S_parse_subquery(QueryParser *self, Vector *elems, String *default_field,
                  bool enclosed);
 
 // Drop unmatched right parens and add matching right parens at end to
 // close paren groups implicitly.
 static void
-S_balance_parens(QueryParser *self, VArray *elems);
+S_balance_parens(QueryParser *self, Vector *elems);
 
 // Work from the inside out, reducing the leftmost, innermost paren groups
 // first, until the array of elems contains no parens.
 static void
-S_parse_subqueries(QueryParser *self, VArray *elems);
+S_parse_subqueries(QueryParser *self, Vector *elems);
 
 static void
-S_compose_inner_queries(QueryParser *self, VArray *elems,
+S_compose_inner_queries(QueryParser *self, Vector *elems,
                         String *default_field);
 
 // Apply +, -, NOT.
 static void
-S_apply_plusses_and_negations(QueryParser *self, VArray *elems);
+S_apply_plusses_and_negations(QueryParser *self, Vector *elems);
 
 // Wrap negated queries with NOTQuery objects.
 static void
-S_compose_not_queries(QueryParser *self, VArray *elems);
+S_compose_not_queries(QueryParser *self, Vector *elems);
 
 // Silently discard non-sensical combos of AND and OR, e.g.
 // 'OR a AND AND OR b AND'.
 static void
-S_winnow_boolops(QueryParser *self, VArray *elems);
+S_winnow_boolops(QueryParser *self, Vector *elems);
 
 // Join ANDQueries.
 static void
-S_compose_and_queries(QueryParser *self, VArray *elems);
+S_compose_and_queries(QueryParser *self, Vector *elems);
 
 // Join ORQueries.
 static void
-S_compose_or_queries(QueryParser *self, VArray *elems);
+S_compose_or_queries(QueryParser *self, Vector *elems);
 
 // Derive a single subquery from all Query objects in the clause.
 static Query*
-S_compose_subquery(QueryParser *self, VArray *elems, bool enclosed);
+S_compose_subquery(QueryParser *self, Vector *elems, bool enclosed);
 
 QueryParser*
 QParser_new(Schema *schema, Analyzer *analyzer, String *default_boolop,
-            VArray *fields) {
+            Vector *fields) {
     QueryParser *self = (QueryParser*)Class_Make_Obj(QUERYPARSER);
     return QParser_init(self, schema, analyzer, default_boolop, fields);
 }
 
 QueryParser*
 QParser_init(QueryParser *self, Schema *schema, Analyzer *analyzer,
-             String *default_boolop, VArray *fields) {
+             String *default_boolop, Vector *fields) {
     QueryParserIVARS *const ivars = QParser_IVARS(self);
     // Init.
     ivars->heed_colons = false;
@@ -119,26 +119,26 @@ QParser_init(QueryParser *self, Schema *schema, Analyzer *analyzer,
                            : Str_new_from_trusted_utf8("OR", 2);
 
     if (fields) {
-        ivars->fields = VA_Clone(fields);
-        for (uint32_t i = 0, max = VA_Get_Size(fields); i < max; i++) {
-            CERTIFY(VA_Fetch(fields, i), STRING);
+        ivars->fields = Vec_Clone(fields);
+        for (uint32_t i = 0, max = Vec_Get_Size(fields); i < max; i++) {
+            CERTIFY(Vec_Fetch(fields, i), STRING);
         }
-        VA_Sort(ivars->fields);
+        Vec_Sort(ivars->fields);
     }
     else {
-        VArray *all_fields = Schema_All_Fields(schema);
-        uint32_t num_fields = VA_Get_Size(all_fields);
-        ivars->fields = VA_new(num_fields);
+        Vector *all_fields = Schema_All_Fields(schema);
+        uint32_t num_fields = Vec_Get_Size(all_fields);
+        ivars->fields = Vec_new(num_fields);
         for (uint32_t i = 0; i < num_fields; i++) {
-            String *field = (String*)VA_Fetch(all_fields, i);
+            String *field = (String*)Vec_Fetch(all_fields, i);
             FieldType *type = Schema_Fetch_Type(schema, field);
             if (type && FType_Indexed(type)) {
-                VA_Push(ivars->fields, INCREF(field));
+                Vec_Push(ivars->fields, INCREF(field));
             }
         }
         DECREF(all_fields);
     }
-    VA_Sort(ivars->fields);
+    Vec_Sort(ivars->fields);
 
     // Derive default "occur" from default boolean operator.
     if (Str_Equals_Utf8(ivars->default_boolop, "OR", 2)) {
@@ -180,7 +180,7 @@ QParser_Get_Default_BoolOp_IMP(QueryParser *self) {
     return QParser_IVARS(self)->default_boolop;
 }
 
-VArray*
+Vector*
 QParser_Get_Fields_IMP(QueryParser *self) {
     return QParser_IVARS(self)->fields;
 }
@@ -215,7 +215,7 @@ QParser_Parse_IMP(QueryParser *self, String *query_string) {
 Query*
 QParser_Tree_IMP(QueryParser *self, String *query_string) {
     QueryParserIVARS *const ivars = QParser_IVARS(self);
-    VArray *elems = QueryLexer_Tokenize(ivars->lexer, query_string);
+    Vector *elems = QueryLexer_Tokenize(ivars->lexer, query_string);
     S_balance_parens(self, elems);
     S_parse_subqueries(self, elems);
     Query *query = S_parse_subquery(self, elems, NULL, false);
@@ -224,7 +224,7 @@ QParser_Tree_IMP(QueryParser *self, String *query_string) {
 }
 
 static void
-S_parse_subqueries(QueryParser *self, VArray *elems) {
+S_parse_subqueries(QueryParser *self, Vector *elems) {
     const int32_t default_occur = QParser_IVARS(self)->default_occur;
     while (1) {
         // Work from the inside out, starting with the leftmost innermost
@@ -232,8 +232,8 @@ S_parse_subqueries(QueryParser *self, VArray *elems) {
         size_t left = SIZE_MAX;
         size_t right = SIZE_MAX;
         String *field = NULL;
-        for (size_t i = 0, max = VA_Get_Size(elems); i < max; i++) {
-            ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+        for (size_t i = 0, max = Vec_Get_Size(elems); i < max; i++) {
+            ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
             uint32_t type = ParserElem_Get_Type(elem);
             if (type == TOKEN_OPEN_PAREN) {
                 left = i;
@@ -244,7 +244,7 @@ S_parse_subqueries(QueryParser *self, VArray *elems) {
             }
             else if (type == TOKEN_FIELD && i < max - 1) {
                 // If a field applies to an enclosing paren, pass it along.
-                ParserElem *next_elem = (ParserElem*)VA_Fetch(elems, i + 1);
+                ParserElem *next_elem = (ParserElem*)Vec_Fetch(elems, i + 1);
                 uint32_t next_type = ParserElem_Get_Type(next_elem);
                 if (next_type == TOKEN_OPEN_PAREN) {
                     field = (String*)ParserElem_As(elem, STRING);
@@ -258,7 +258,7 @@ S_parse_subqueries(QueryParser *self, VArray *elems) {
         }
 
         // Create the subquery.
-        VArray *sub_elems = VA_Slice(elems, left + 1, right - left - 1);
+        Vector *sub_elems = Vec_Slice(elems, left + 1, right - left - 1);
         Query *subquery = S_parse_subquery(self, sub_elems, field, true);
         ParserElem *new_elem = ParserElem_new(TOKEN_QUERY, (Obj*)subquery);
         if (default_occur == MUST) {
@@ -269,34 +269,34 @@ S_parse_subqueries(QueryParser *self, VArray *elems) {
         // Replace the elements used to create the subquery with the subquery
         // itself.
         if (left > 0) {
-            ParserElem *maybe_field = (ParserElem*)VA_Fetch(elems, left - 1);
+            ParserElem *maybe_field = (ParserElem*)Vec_Fetch(elems, left - 1);
             uint32_t maybe_field_type = ParserElem_Get_Type(maybe_field);
             if (maybe_field_type == TOKEN_FIELD) {
                 left -= 1;
             }
         }
-        VA_Excise(elems, left + 1, right - left);
-        VA_Store(elems, left, (Obj*)new_elem);
+        Vec_Excise(elems, left + 1, right - left);
+        Vec_Store(elems, left, (Obj*)new_elem);
     }
 }
 
 static void
-S_discard_elems(VArray *elems, uint32_t type) {
-    for (size_t i = VA_Get_Size(elems); i--;) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
-        if (ParserElem_Get_Type(elem) == type) { VA_Excise(elems, i, 1); }
+S_discard_elems(Vector *elems, uint32_t type) {
+    for (size_t i = Vec_Get_Size(elems); i--;) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
+        if (ParserElem_Get_Type(elem) == type) { Vec_Excise(elems, i, 1); }
     }
 }
 
 static Query*
-S_parse_subquery(QueryParser *self, VArray *elems, String *default_field,
+S_parse_subquery(QueryParser *self, Vector *elems, String *default_field,
                  bool enclosed) {
-    if (VA_Get_Size(elems)) {
-        ParserElem *first = (ParserElem*)VA_Fetch(elems, 0);
+    if (Vec_Get_Size(elems)) {
+        ParserElem *first = (ParserElem*)Vec_Fetch(elems, 0);
         if (ParserElem_Get_Type(first) == TOKEN_OPEN_PAREN) {
             enclosed = true;
-            VA_Excise(elems, 0, 1);
-            DECREF(VA_Pop(elems));
+            Vec_Excise(elems, 0, 1);
+            DECREF(Vec_Pop(elems));
         }
     }
     S_compose_inner_queries(self, elems, default_field);
@@ -308,16 +308,16 @@ S_parse_subquery(QueryParser *self, VArray *elems, String *default_field,
     S_discard_elems(elems, TOKEN_NOT);
     S_compose_not_queries(self, elems);
     S_winnow_boolops(self, elems);
-    if (VA_Get_Size(elems) > 2) {
+    if (Vec_Get_Size(elems) > 2) {
         S_compose_and_queries(self, elems);
         // Don't double wrap '(a AND b)'.
-        if (VA_Get_Size(elems) == 1) { enclosed = false; }
+        if (Vec_Get_Size(elems) == 1) { enclosed = false; }
     }
     S_discard_elems(elems, TOKEN_AND);
-    if (VA_Get_Size(elems) > 2) {
+    if (Vec_Get_Size(elems) > 2) {
         S_compose_or_queries(self, elems);
         // Don't double wrap '(a OR b)'.
-        if (VA_Get_Size(elems) == 1) { enclosed = false; }
+        if (Vec_Get_Size(elems) == 1) { enclosed = false; }
     }
     S_discard_elems(elems, TOKEN_OR);
     Query *retval = S_compose_subquery(self, elems, enclosed);
@@ -326,13 +326,13 @@ S_parse_subquery(QueryParser *self, VArray *elems, String *default_field,
 }
 
 static void
-S_balance_parens(QueryParser *self, VArray *elems) {
+S_balance_parens(QueryParser *self, Vector *elems) {
     UNUSED_VAR(self);
     // Count paren balance, eliminate unbalanced right parens.
     int64_t paren_depth = 0;
     size_t i = 0;
-    while (i < VA_Get_Size(elems)) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+    while (i < Vec_Get_Size(elems)) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
         if (ParserElem_Get_Type(elem) == TOKEN_OPEN_PAREN) {
             paren_depth++;
         }
@@ -341,7 +341,7 @@ S_balance_parens(QueryParser *self, VArray *elems) {
                 paren_depth--;
             }
             else {
-                VA_Excise(elems, i, 1);
+                Vec_Excise(elems, i, 1);
                 continue;
             }
         }
@@ -351,25 +351,25 @@ S_balance_parens(QueryParser *self, VArray *elems) {
     // Insert implicit parens.
     while (paren_depth--) {
         ParserElem *elem = ParserElem_new(TOKEN_CLOSE_PAREN, NULL);
-        VA_Push(elems, (Obj*)elem);
+        Vec_Push(elems, (Obj*)elem);
     }
 }
 
 static void
-S_compose_inner_queries(QueryParser *self, VArray *elems,
+S_compose_inner_queries(QueryParser *self, Vector *elems,
                         String *default_field) {
     const int32_t default_occur = QParser_IVARS(self)->default_occur;
 
     // Generate all queries.  Apply any fields.
-    for (uint32_t i = VA_Get_Size(elems); i--;) {
+    for (uint32_t i = Vec_Get_Size(elems); i--;) {
         String *field = default_field;
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
 
         // Apply field.
         if (i > 0) {
             // Field specifier must immediately precede any query.
             ParserElem* maybe_field_elem
-                = (ParserElem*)VA_Fetch(elems, i - 1);
+                = (ParserElem*)Vec_Fetch(elems, i - 1);
             if (ParserElem_Get_Type(maybe_field_elem) == TOKEN_FIELD) {
                 field = (String*)ParserElem_As(maybe_field_elem, STRING);
             }
@@ -383,19 +383,19 @@ S_compose_inner_queries(QueryParser *self, VArray *elems,
             if (default_occur == MUST) {
                 ParserElem_Require(new_elem);
             }
-            VA_Store(elems, i, (Obj*)new_elem);
+            Vec_Store(elems, i, (Obj*)new_elem);
         }
     }
 }
 
 static void
-S_apply_plusses_and_negations(QueryParser *self, VArray *elems) {
+S_apply_plusses_and_negations(QueryParser *self, Vector *elems) {
     UNUSED_VAR(self);
-    for (uint32_t i = VA_Get_Size(elems); i--;) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+    for (uint32_t i = Vec_Get_Size(elems); i--;) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
         if (ParserElem_Get_Type(elem) == TOKEN_QUERY) {
             for (uint32_t j = i; j--;) {
-                ParserElem *prev = (ParserElem*)VA_Fetch(elems, j);
+                ParserElem *prev = (ParserElem*)Vec_Fetch(elems, j);
                 uint32_t prev_type = ParserElem_Get_Type(prev);
                 if (prev_type == TOKEN_MINUS || prev_type == TOKEN_NOT) {
                     ParserElem_Negate(elem);
@@ -412,9 +412,9 @@ S_apply_plusses_and_negations(QueryParser *self, VArray *elems) {
 }
 
 static void
-S_compose_not_queries(QueryParser *self, VArray *elems) {
-    for (uint32_t i = 0, max = VA_Get_Size(elems); i < max; i++) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+S_compose_not_queries(QueryParser *self, Vector *elems) {
+    for (uint32_t i = 0, max = Vec_Get_Size(elems); i < max; i++) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
         if (ParserElem_Get_Type(elem) == TOKEN_QUERY
             && ParserElem_Negated(elem)
            ) {
@@ -427,59 +427,59 @@ S_compose_not_queries(QueryParser *self, VArray *elems) {
 }
 
 static void
-S_winnow_boolops(QueryParser *self, VArray *elems) {
+S_winnow_boolops(QueryParser *self, Vector *elems) {
     UNUSED_VAR(self);
-    for (uint32_t i = 0; i < VA_Get_Size(elems); i++) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+    for (uint32_t i = 0; i < Vec_Get_Size(elems); i++) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
         if (ParserElem_Get_Type(elem) != TOKEN_QUERY) {
             uint32_t num_to_zap = 0;
-            ParserElem *preceding = (ParserElem*)VA_Fetch(elems, i - 1);
-            ParserElem *following = (ParserElem*)VA_Fetch(elems, i + 1);
+            ParserElem *preceding = (ParserElem*)Vec_Fetch(elems, i - 1);
+            ParserElem *following = (ParserElem*)Vec_Fetch(elems, i + 1);
             if (!preceding || ParserElem_Get_Type(preceding) != TOKEN_QUERY) {
                 num_to_zap = 1;
             }
             if (!following || ParserElem_Get_Type(following) != TOKEN_QUERY) {
                 num_to_zap = 1;
             }
-            for (uint32_t j = i + 1, jmax = VA_Get_Size(elems); j < jmax; j++) {
-                ParserElem *maybe = (ParserElem*)VA_Fetch(elems, j);
+            for (uint32_t j = i + 1, jmax = Vec_Get_Size(elems); j < jmax; j++) {
+                ParserElem *maybe = (ParserElem*)Vec_Fetch(elems, j);
                 if (ParserElem_Get_Type(maybe) == TOKEN_QUERY) { break; }
                 else { num_to_zap++; }
             }
-            if (num_to_zap) { VA_Excise(elems, i, num_to_zap); }
+            if (num_to_zap) { Vec_Excise(elems, i, num_to_zap); }
         }
     }
 }
 
 // Apply AND.
 static void
-S_compose_and_queries(QueryParser *self, VArray *elems) {
+S_compose_and_queries(QueryParser *self, Vector *elems) {
     const int32_t default_occur = QParser_IVARS(self)->default_occur;
 
-    for (uint32_t i = 0; i + 2 < VA_Get_Size(elems); i++) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i + 1);
+    for (uint32_t i = 0; i + 2 < Vec_Get_Size(elems); i++) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i + 1);
         if (ParserElem_Get_Type(elem) == TOKEN_AND) {
-            ParserElem   *preceding  = (ParserElem*)VA_Fetch(elems, i);
-            VArray       *children   = VA_new(2);
+            ParserElem   *preceding  = (ParserElem*)Vec_Fetch(elems, i);
+            Vector       *children   = Vec_new(2);
             uint32_t      num_to_zap = 0;
 
             // Add first clause.
             Query *preceding_query = (Query*)ParserElem_As(preceding, QUERY);
-            VA_Push(children, INCREF(preceding_query));
+            Vec_Push(children, INCREF(preceding_query));
 
             // Add following clauses.
-            for (uint32_t j = i + 1, jmax = VA_Get_Size(elems);
+            for (uint32_t j = i + 1, jmax = Vec_Get_Size(elems);
                  j < jmax;
                  j += 2, num_to_zap += 2
                 ) {
-                ParserElem *maybe_and = (ParserElem*)VA_Fetch(elems, j);
-                ParserElem *following = (ParserElem*)VA_Fetch(elems, j + 1);
+                ParserElem *maybe_and = (ParserElem*)Vec_Fetch(elems, j);
+                ParserElem *following = (ParserElem*)Vec_Fetch(elems, j + 1);
                 if (ParserElem_Get_Type(maybe_and) != TOKEN_AND) {
                     break;
                 }
                 else if (ParserElem_Get_Type(following) == TOKEN_QUERY) {
                     Query *next = (Query*)ParserElem_As(following, QUERY);
-                    VA_Push(children, INCREF(next));
+                    Vec_Push(children, INCREF(next));
                 }
                 else {
                     THROW(ERR, "Unexpected type: %u32",
@@ -494,39 +494,39 @@ S_compose_and_queries(QueryParser *self, VArray *elems) {
             DECREF(and_query);
             DECREF(children);
 
-            VA_Excise(elems, i + 1, num_to_zap);
+            Vec_Excise(elems, i + 1, num_to_zap);
         }
     }
 }
 
 static void
-S_compose_or_queries(QueryParser *self, VArray *elems) {
+S_compose_or_queries(QueryParser *self, Vector *elems) {
     const int32_t default_occur = QParser_IVARS(self)->default_occur;
 
-    for (uint32_t i = 0; i + 2 < VA_Get_Size(elems); i++) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, i + 1);
+    for (uint32_t i = 0; i + 2 < Vec_Get_Size(elems); i++) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i + 1);
         if (ParserElem_Get_Type(elem) == TOKEN_OR) {
-            ParserElem   *preceding  = (ParserElem*)VA_Fetch(elems, i);
-            VArray       *children   = VA_new(2);
+            ParserElem   *preceding  = (ParserElem*)Vec_Fetch(elems, i);
+            Vector       *children   = Vec_new(2);
             uint32_t      num_to_zap = 0;
 
             // Add first clause.
             Query *preceding_query = (Query*)ParserElem_As(preceding, QUERY);
-            VA_Push(children, INCREF(preceding_query));
+            Vec_Push(children, INCREF(preceding_query));
 
             // Add following clauses.
-            for (uint32_t j = i + 1, jmax = VA_Get_Size(elems);
+            for (uint32_t j = i + 1, jmax = Vec_Get_Size(elems);
                  j < jmax;
                  j += 2, num_to_zap += 2
                 ) {
-                ParserElem *maybe_or  = (ParserElem*)VA_Fetch(elems, j);
-                ParserElem *following = (ParserElem*)VA_Fetch(elems, j + 1);
+                ParserElem *maybe_or  = (ParserElem*)Vec_Fetch(elems, j);
+                ParserElem *following = (ParserElem*)Vec_Fetch(elems, j + 1);
                 if (ParserElem_Get_Type(maybe_or) != TOKEN_OR) {
                     break;
                 }
                 else if (ParserElem_Get_Type(following) == TOKEN_QUERY) {
                     Query *next = (Query*)ParserElem_As(following, QUERY);
-                    VA_Push(children, INCREF(next));
+                    Vec_Push(children, INCREF(next));
                 }
                 else {
                     THROW(ERR, "Unexpected type: %u32",
@@ -541,17 +541,17 @@ S_compose_or_queries(QueryParser *self, VArray *elems) {
             DECREF(or_query);
             DECREF(children);
 
-            VA_Excise(elems, i + 1, num_to_zap);
+            Vec_Excise(elems, i + 1, num_to_zap);
         }
     }
 }
 
 static Query*
-S_compose_subquery(QueryParser *self, VArray *elems, bool enclosed) {
+S_compose_subquery(QueryParser *self, Vector *elems, bool enclosed) {
     const int32_t default_occur = QParser_IVARS(self)->default_occur;
     Query *retval;
 
-    if (VA_Get_Size(elems) == 0) {
+    if (Vec_Get_Size(elems) == 0) {
         // No elems means no query. Maybe the search string was something
         // like 'NOT AND'
         if (enclosed) {
@@ -563,56 +563,56 @@ S_compose_subquery(QueryParser *self, VArray *elems, bool enclosed) {
             retval = (Query*)NoMatchQuery_new();
         }
     }
-    else if (VA_Get_Size(elems) == 1 && !enclosed) {
-        ParserElem *elem = (ParserElem*)VA_Fetch(elems, 0);
+    else if (Vec_Get_Size(elems) == 1 && !enclosed) {
+        ParserElem *elem = (ParserElem*)Vec_Fetch(elems, 0);
         Query *query = (Query*)ParserElem_As(elem, QUERY);
         retval = (Query*)INCREF(query);
     }
     else {
-        uint32_t  num_elems = VA_Get_Size(elems);
-        VArray   *required  = VA_new(num_elems);
-        VArray   *optional  = VA_new(num_elems);
-        VArray   *negated   = VA_new(num_elems);
+        uint32_t  num_elems = Vec_Get_Size(elems);
+        Vector   *required  = Vec_new(num_elems);
+        Vector   *optional  = Vec_new(num_elems);
+        Vector   *negated   = Vec_new(num_elems);
         Query    *req_query = NULL;
         Query    *opt_query = NULL;
 
         // Demux elems into bins.
         for (uint32_t i = 0; i < num_elems; i++) {
-            ParserElem *elem = (ParserElem*)VA_Fetch(elems, i);
+            ParserElem *elem = (ParserElem*)Vec_Fetch(elems, i);
             if (ParserElem_Required(elem)) {
-                VA_Push(required, INCREF(ParserElem_As(elem, QUERY)));
+                Vec_Push(required, INCREF(ParserElem_As(elem, QUERY)));
             }
             else if (ParserElem_Optional(elem)) {
-                VA_Push(optional, INCREF(ParserElem_As(elem, QUERY)));
+                Vec_Push(optional, INCREF(ParserElem_As(elem, QUERY)));
             }
             else if (ParserElem_Negated(elem)) {
-                VA_Push(negated, INCREF(ParserElem_As(elem, QUERY)));
+                Vec_Push(negated, INCREF(ParserElem_As(elem, QUERY)));
             }
         }
-        uint32_t num_required = VA_Get_Size(required);
-        uint32_t num_negated  = VA_Get_Size(negated);
-        uint32_t num_optional = VA_Get_Size(optional);
+        uint32_t num_required = Vec_Get_Size(required);
+        uint32_t num_negated  = Vec_Get_Size(negated);
+        uint32_t num_optional = Vec_Get_Size(optional);
 
         // Bind all mandatory matchers together in one Query.
         if (num_required || num_negated) {
             if (enclosed || num_required + num_negated > 1) {
-                VArray *children = VA_Clone(required);
-                VA_Push_All(children, negated);
+                Vector *children = Vec_Clone(required);
+                Vec_Push_All(children, negated);
                 req_query = QParser_Make_AND_Query(self, children);
                 DECREF(children);
             }
             else if (num_required) {
-                req_query = (Query*)INCREF(VA_Fetch(required, 0));
+                req_query = (Query*)INCREF(Vec_Fetch(required, 0));
             }
             else if (num_negated) {
-                req_query = (Query*)INCREF(VA_Fetch(negated, 0));
+                req_query = (Query*)INCREF(Vec_Fetch(negated, 0));
             }
         }
 
         // Bind all optional matchers together in one Query.
         if (num_optional) {
             if (!enclosed && num_optional == 1) {
-                opt_query = (Query*)INCREF(VA_Fetch(optional, 0));
+                opt_query = (Query*)INCREF(Vec_Fetch(optional, 0));
             }
             else {
                 opt_query = QParser_Make_OR_Query(self, optional);
@@ -627,9 +627,9 @@ S_compose_subquery(QueryParser *self, VArray *elems, bool enclosed) {
             }
             else {
                 // req_query has only negated queries.
-                VArray *children = VA_new(2);
-                VA_Push(children, INCREF(req_query));
-                VA_Push(children, INCREF(opt_query));
+                Vector *children = Vec_new(2);
+                Vec_Push(children, INCREF(req_query));
+                Vec_Push(children, INCREF(opt_query));
                 retval = QParser_Make_AND_Query(self, children);
                 DECREF(children);
             }
@@ -667,9 +667,9 @@ S_has_valid_clauses(Query *query) {
     }
     else if (Query_Is_A(query, ORQUERY) || Query_Is_A(query, ANDQUERY)) {
         PolyQuery *polyquery = (PolyQuery*)query;
-        VArray    *children  = PolyQuery_Get_Children(polyquery);
-        for (uint32_t i = 0, max = VA_Get_Size(children); i < max; i++) {
-            Query *child = (Query*)VA_Fetch(children, i);
+        Vector    *children  = PolyQuery_Get_Children(polyquery);
+        for (uint32_t i = 0, max = Vec_Get_Size(children); i < max; i++) {
+            Query *child = (Query*)Vec_Fetch(children, i);
             if (S_has_valid_clauses(child)) {
                 return true;
             }
@@ -695,11 +695,11 @@ S_do_prune(QueryParser *self, Query *query) {
     }
     else if (Query_Is_A(query, POLYQUERY)) {
         PolyQuery *polyquery = (PolyQuery*)query;
-        VArray    *children  = PolyQuery_Get_Children(polyquery);
+        Vector    *children  = PolyQuery_Get_Children(polyquery);
 
         // Recurse.
-        for (uint32_t i = 0, max = VA_Get_Size(children); i < max; i++) {
-            Query *child = (Query*)VA_Fetch(children, i);
+        for (uint32_t i = 0, max = Vec_Get_Size(children); i < max; i++) {
+            Query *child = (Query*)Vec_Fetch(children, i);
             S_do_prune(self, child);
         }
 
@@ -707,19 +707,19 @@ S_do_prune(QueryParser *self, Query *query) {
             || PolyQuery_Is_A(polyquery, ORQUERY)
            ) {
             // Don't allow 'foo OR (-bar)'.
-            VArray *children = PolyQuery_Get_Children(polyquery);
-            for (uint32_t i = 0, max = VA_Get_Size(children); i < max; i++) {
-                Query *child = (Query*)VA_Fetch(children, i);
+            Vector *children = PolyQuery_Get_Children(polyquery);
+            for (uint32_t i = 0, max = Vec_Get_Size(children); i < max; i++) {
+                Query *child = (Query*)Vec_Fetch(children, i);
                 if (!S_has_valid_clauses(child)) {
-                    VA_Store(children, i, (Obj*)NoMatchQuery_new());
+                    Vec_Store(children, i, (Obj*)NoMatchQuery_new());
                 }
             }
         }
         else if (PolyQuery_Is_A(polyquery, ANDQUERY)) {
             // Don't allow '(-bar AND -baz)'.
             if (!S_has_valid_clauses((Query*)polyquery)) {
-                VArray *children = PolyQuery_Get_Children(polyquery);
-                VA_Clear(children);
+                Vector *children = PolyQuery_Get_Children(polyquery);
+                Vec_Clear(children);
             }
         }
     }
@@ -748,34 +748,34 @@ QParser_Expand_IMP(QueryParser *self, Query *query) {
     }
     else if (Query_Is_A(query, ORQUERY) || Query_Is_A(query, ANDQUERY)) {
         PolyQuery *polyquery = (PolyQuery*)query;
-        VArray *children = PolyQuery_Get_Children(polyquery);
-        VArray *new_kids = VA_new(VA_Get_Size(children));
+        Vector *children = PolyQuery_Get_Children(polyquery);
+        Vector *new_kids = Vec_new(Vec_Get_Size(children));
 
-        for (uint32_t i = 0, max = VA_Get_Size(children); i < max; i++) {
-            Query *child = (Query*)VA_Fetch(children, i);
+        for (uint32_t i = 0, max = Vec_Get_Size(children); i < max; i++) {
+            Query *child = (Query*)Vec_Fetch(children, i);
             Query *new_child = QParser_Expand(self, child); // recurse
             if (new_child) {
                 if (Query_Is_A(new_child, NOMATCHQUERY)) {
                     bool fails = NoMatchQuery_Get_Fails_To_Match(
                                        (NoMatchQuery*)new_child);
                     if (fails) {
-                        VA_Push(new_kids, (Obj*)new_child);
+                        Vec_Push(new_kids, (Obj*)new_child);
                     }
                     else {
                         DECREF(new_child);
                     }
                 }
                 else {
-                    VA_Push(new_kids, (Obj*)new_child);
+                    Vec_Push(new_kids, (Obj*)new_child);
                 }
             }
         }
 
-        if (VA_Get_Size(new_kids) == 0) {
+        if (Vec_Get_Size(new_kids) == 0) {
             retval = (Query*)NoMatchQuery_new();
         }
-        else if (VA_Get_Size(new_kids) == 1) {
-            retval = (Query*)INCREF(VA_Fetch(new_kids, 0));
+        else if (Vec_Get_Size(new_kids) == 1) {
+            retval = (Query*)INCREF(Vec_Fetch(new_kids, 0));
         }
         else {
             PolyQuery_Set_Children(polyquery, new_kids);
@@ -888,56 +888,56 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
     String *source_text = StrIter_substring(top, tail);
 
     // Either use LeafQuery's field or default to Parser's list.
-    VArray *fields;
+    Vector *fields;
     if (LeafQuery_Get_Field(leaf_query)) {
-        fields = VA_new(1);
-        VA_Push(fields, INCREF(LeafQuery_Get_Field(leaf_query)));
+        fields = Vec_new(1);
+        Vec_Push(fields, INCREF(LeafQuery_Get_Field(leaf_query)));
     }
     else {
-        fields = (VArray*)INCREF(ivars->fields);
+        fields = (Vector*)INCREF(ivars->fields);
     }
 
     CharBuf *unescape_buf = CB_new(Str_Get_Size(source_text));
-    VArray  *queries      = VA_new(VA_Get_Size(fields));
-    for (uint32_t i = 0, max = VA_Get_Size(fields); i < max; i++) {
-        String   *field    = (String*)VA_Fetch(fields, i);
+    Vector  *queries      = Vec_new(Vec_Get_Size(fields));
+    for (uint32_t i = 0, max = Vec_Get_Size(fields); i < max; i++) {
+        String   *field    = (String*)Vec_Fetch(fields, i);
         Analyzer *analyzer = ivars->analyzer
                              ? ivars->analyzer
                              : Schema_Fetch_Analyzer(schema, field);
 
         if (!analyzer) {
-            VA_Push(queries,
+            Vec_Push(queries,
                     (Obj*)QParser_Make_Term_Query(self, field,
                                                   (Obj*)source_text));
         }
         else {
             // Extract token texts.
             String *split_source = S_unescape(self, source_text, unescape_buf);
-            VArray *maybe_texts = Analyzer_Split(analyzer, split_source);
-            uint32_t num_maybe_texts = VA_Get_Size(maybe_texts);
-            VArray *token_texts = VA_new(num_maybe_texts);
+            Vector *maybe_texts = Analyzer_Split(analyzer, split_source);
+            uint32_t num_maybe_texts = Vec_Get_Size(maybe_texts);
+            Vector *token_texts = Vec_new(num_maybe_texts);
 
             // Filter out zero-length token texts.
             for (uint32_t j = 0; j < num_maybe_texts; j++) {
-                String *token_text = (String*)VA_Fetch(maybe_texts, j);
+                String *token_text = (String*)Vec_Fetch(maybe_texts, j);
                 if (Str_Get_Size(token_text)) {
-                    VA_Push(token_texts, INCREF(token_text));
+                    Vec_Push(token_texts, INCREF(token_text));
                 }
             }
 
-            if (VA_Get_Size(token_texts) == 0) {
+            if (Vec_Get_Size(token_texts) == 0) {
                 /* Query might include stop words.  Who knows? */
                 ambiguous = true;
             }
 
             // Add either a TermQuery or a PhraseQuery.
-            if (is_phrase || VA_Get_Size(token_texts) > 1) {
-                VA_Push(queries, (Obj*)
+            if (is_phrase || Vec_Get_Size(token_texts) > 1) {
+                Vec_Push(queries, (Obj*)
                         QParser_Make_Phrase_Query(self, field, token_texts));
             }
-            else if (VA_Get_Size(token_texts) == 1) {
-                VA_Push(queries,
-                        (Obj*)QParser_Make_Term_Query(self, field, VA_Fetch(token_texts, 0)));
+            else if (Vec_Get_Size(token_texts) == 1) {
+                Vec_Push(queries,
+                        (Obj*)QParser_Make_Term_Query(self, field, Vec_Fetch(token_texts, 0)));
             }
 
             DECREF(token_texts);
@@ -947,14 +947,14 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
     }
 
     Query *retval;
-    if (VA_Get_Size(queries) == 0) {
+    if (Vec_Get_Size(queries) == 0) {
         retval = (Query*)NoMatchQuery_new();
         if (ambiguous) {
             NoMatchQuery_Set_Fails_To_Match((NoMatchQuery*)retval, false);
         }
     }
-    else if (VA_Get_Size(queries) == 1) {
-        retval = (Query*)INCREF(VA_Fetch(queries, 0));
+    else if (Vec_Get_Size(queries) == 1) {
+        retval = (Query*)INCREF(Vec_Fetch(queries, 0));
     }
     else {
         retval = QParser_Make_OR_Query(self, queries);
@@ -980,19 +980,19 @@ QParser_Make_Term_Query_IMP(QueryParser *self, String *field,
 
 Query*
 QParser_Make_Phrase_Query_IMP(QueryParser *self, String *field,
-                              VArray *terms) {
+                              Vector *terms) {
     UNUSED_VAR(self);
     return (Query*)PhraseQuery_new(field, terms);
 }
 
 Query*
-QParser_Make_OR_Query_IMP(QueryParser *self, VArray *children) {
+QParser_Make_OR_Query_IMP(QueryParser *self, Vector *children) {
     UNUSED_VAR(self);
     return (Query*)ORQuery_new(children);
 }
 
 Query*
-QParser_Make_AND_Query_IMP(QueryParser *self, VArray *children) {
+QParser_Make_AND_Query_IMP(QueryParser *self, Vector *children) {
     UNUSED_VAR(self);
     return (Query*)ANDQuery_new(children);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/QueryParser.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.cfh b/core/Lucy/Search/QueryParser.cfh
index 4c1f1a6..376ddfb 100644
--- a/core/Lucy/Search/QueryParser.cfh
+++ b/core/Lucy/Search/QueryParser.cfh
@@ -46,14 +46,14 @@ public class Lucy::Search::QueryParser nickname QParser
     Schema     *schema;
     Analyzer   *analyzer;
     String     *default_boolop;
-    VArray     *fields;
+    Vector     *fields;
     QueryLexer *lexer;
     bool        heed_colons;
     int32_t     default_occur;
 
     inert incremented QueryParser*
     new(Schema *schema, Analyzer *analyzer = NULL,
-        String *default_boolop = NULL, VArray *fields = NULL);
+        String *default_boolop = NULL, Vector *fields = NULL);
 
     /** Constructor.
      *
@@ -73,7 +73,7 @@ public class Lucy::Search::QueryParser nickname QParser
      */
     public inert QueryParser*
     init(QueryParser *self, Schema *schema, Analyzer *analyzer = NULL,
-        String *default_boolop = NULL, VArray *fields = NULL);
+        String *default_boolop = NULL, Vector *fields = NULL);
 
     /** Build a Query object from the contents of a query string.  At present,
      * implemented internally by calling [](cfish:.Tree), [](cfish:.Expand), and [](cfish:.Prune).
@@ -166,7 +166,7 @@ public class Lucy::Search::QueryParser nickname QParser
      * @return A Query.
      */
     public incremented Query*
-    Make_Phrase_Query(QueryParser *self, String *field, VArray *terms);
+    Make_Phrase_Query(QueryParser *self, String *field, Vector *terms);
 
     /** Factory method creating an ORQuery.
      *
@@ -174,7 +174,7 @@ public class Lucy::Search::QueryParser nickname QParser
      * @return A Query.
      */
     public incremented Query*
-    Make_OR_Query(QueryParser *self, VArray *children = NULL);
+    Make_OR_Query(QueryParser *self, Vector *children = NULL);
 
     /** Factory method creating an ANDQuery.
      *
@@ -182,7 +182,7 @@ public class Lucy::Search::QueryParser nickname QParser
      * @return A Query.
      */
     public incremented Query*
-    Make_AND_Query(QueryParser *self, VArray *children = NULL);
+    Make_AND_Query(QueryParser *self, Vector *children = NULL);
 
     /** Factory method creating a NOTQuery.
      *
@@ -211,7 +211,7 @@ public class Lucy::Search::QueryParser nickname QParser
     String*
     Get_Default_BoolOp(QueryParser *self);
 
-    VArray*
+    Vector*
     Get_Fields(QueryParser *self);
 
     bool

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/QueryParser/QueryLexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.c b/core/Lucy/Search/QueryParser/QueryLexer.c
index 6c7c866..76596c4 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.c
+++ b/core/Lucy/Search/QueryParser/QueryLexer.c
@@ -70,11 +70,11 @@ QueryLexer_Set_Heed_Colons_IMP(QueryLexer *self, bool heed_colons) {
     QueryLexer_IVARS(self)->heed_colons = heed_colons;
 }
 
-VArray*
+Vector*
 QueryLexer_Tokenize_IMP(QueryLexer *self, String *query_string) {
     QueryLexerIVARS *const ivars = QueryLexer_IVARS(self);
 
-    VArray *elems = VA_new(0);
+    Vector *elems = Vec_new(0);
     if (!query_string) { return elems; }
 
     StringIterator *iter = Str_Top(query_string);
@@ -90,7 +90,7 @@ QueryLexer_Tokenize_IMP(QueryLexer *self, String *query_string) {
         if (ivars->heed_colons) {
             ParserElem *elem = S_consume_field(iter);
             if (elem) {
-                VA_Push(elems, (Obj*)elem);
+                Vec_Push(elems, (Obj*)elem);
             }
         }
 
@@ -152,7 +152,7 @@ QueryLexer_Tokenize_IMP(QueryLexer *self, String *query_string) {
                 elem = S_consume_text(iter);
                 break;
         }
-        VA_Push(elems, (Obj*)elem);
+        Vec_Push(elems, (Obj*)elem);
     }
 
     DECREF(iter);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/QueryParser/QueryLexer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.cfh b/core/Lucy/Search/QueryParser/QueryLexer.cfh
index e2f377c..3496eb6 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.cfh
+++ b/core/Lucy/Search/QueryParser/QueryLexer.cfh
@@ -31,7 +31,7 @@ class Lucy::Search::QueryParser::QueryLexer inherits Clownfish::Obj {
      * @param query_string The string to be parsed.  May be NULL.
      * @return an array of ParserElems.
      */
-    incremented VArray*
+    incremented Vector*
     Tokenize(QueryLexer *self, String *query_string = NULL);
 
     bool

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/RequiredOptionalMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/RequiredOptionalMatcher.c b/core/Lucy/Search/RequiredOptionalMatcher.c
index 5735a90..855db48 100644
--- a/core/Lucy/Search/RequiredOptionalMatcher.c
+++ b/core/Lucy/Search/RequiredOptionalMatcher.c
@@ -32,9 +32,9 @@ ReqOptMatcher_new(Similarity *similarity, Matcher *required_matcher,
 RequiredOptionalMatcher*
 ReqOptMatcher_init(RequiredOptionalMatcher *self, Similarity *similarity,
                    Matcher *required_matcher, Matcher *optional_matcher) {
-    VArray *children = VA_new(2);
-    VA_Push(children, INCREF(required_matcher));
-    VA_Push(children, INCREF(optional_matcher));
+    Vector *children = Vec_new(2);
+    Vec_Push(children, INCREF(required_matcher));
+    Vec_Push(children, INCREF(optional_matcher));
     PolyMatcher_init((PolyMatcher*)self, children, similarity);
     RequiredOptionalMatcherIVARS *const ivars = ReqOptMatcher_IVARS(self);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/RequiredOptionalQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/RequiredOptionalQuery.c b/core/Lucy/Search/RequiredOptionalQuery.c
index d43d5dc..a90f841 100644
--- a/core/Lucy/Search/RequiredOptionalQuery.c
+++ b/core/Lucy/Search/RequiredOptionalQuery.c
@@ -37,42 +37,42 @@ ReqOptQuery_init(RequiredOptionalQuery *self, Query *required_query,
                  Query *optional_query) {
     PolyQuery_init((PolyQuery*)self, NULL);
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    VA_Push(ivars->children, INCREF(required_query));
-    VA_Push(ivars->children, INCREF(optional_query));
+    Vec_Push(ivars->children, INCREF(required_query));
+    Vec_Push(ivars->children, INCREF(optional_query));
     return self;
 }
 
 Query*
 ReqOptQuery_Get_Required_Query_IMP(RequiredOptionalQuery *self) {
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    return (Query*)VA_Fetch(ivars->children, 0);
+    return (Query*)Vec_Fetch(ivars->children, 0);
 }
 
 void
 ReqOptQuery_Set_Required_Query_IMP(RequiredOptionalQuery *self,
                                    Query *required_query) {
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    VA_Store(ivars->children, 0, INCREF(required_query));
+    Vec_Store(ivars->children, 0, INCREF(required_query));
 }
 
 Query*
 ReqOptQuery_Get_Optional_Query_IMP(RequiredOptionalQuery *self) {
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    return (Query*)VA_Fetch(ivars->children, 1);
+    return (Query*)Vec_Fetch(ivars->children, 1);
 }
 
 void
 ReqOptQuery_Set_Optional_Query_IMP(RequiredOptionalQuery *self,
                                    Query *optional_query) {
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    VA_Store(ivars->children, 1, INCREF(optional_query));
+    Vec_Store(ivars->children, 1, INCREF(optional_query));
 }
 
 String*
 ReqOptQuery_To_String_IMP(RequiredOptionalQuery *self) {
     RequiredOptionalQueryIVARS *const ivars = ReqOptQuery_IVARS(self);
-    String *req_string = Obj_To_String(VA_Fetch(ivars->children, 0));
-    String *opt_string = Obj_To_String(VA_Fetch(ivars->children, 1));
+    String *req_string = Obj_To_String(Vec_Fetch(ivars->children, 0));
+    String *opt_string = Obj_To_String(Vec_Fetch(ivars->children, 1));
     String *retval = Str_newf("(+%o %o)", req_string, opt_string);
     DECREF(opt_string);
     DECREF(req_string);
@@ -126,8 +126,8 @@ ReqOptCompiler_Make_Matcher_IMP(RequiredOptionalCompiler *self,
     RequiredOptionalCompilerIVARS *const ivars = ReqOptCompiler_IVARS(self);
     Schema     *schema       = SegReader_Get_Schema(reader);
     Similarity *sim          = Schema_Get_Similarity(schema);
-    Compiler   *req_compiler = (Compiler*)VA_Fetch(ivars->children, 0);
-    Compiler   *opt_compiler = (Compiler*)VA_Fetch(ivars->children, 1);
+    Compiler   *req_compiler = (Compiler*)Vec_Fetch(ivars->children, 0);
+    Compiler   *opt_compiler = (Compiler*)Vec_Fetch(ivars->children, 1);
     Matcher *req_matcher
         = Compiler_Make_Matcher(req_compiler, reader, need_score);
     Matcher *opt_matcher

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/SeriesMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SeriesMatcher.c b/core/Lucy/Search/SeriesMatcher.c
index 2f5176c..a36d820 100644
--- a/core/Lucy/Search/SeriesMatcher.c
+++ b/core/Lucy/Search/SeriesMatcher.c
@@ -20,13 +20,13 @@
 #include "Lucy/Search/SeriesMatcher.h"
 
 SeriesMatcher*
-SeriesMatcher_new(VArray *matchers, I32Array *offsets) {
+SeriesMatcher_new(Vector *matchers, I32Array *offsets) {
     SeriesMatcher *self = (SeriesMatcher*)Class_Make_Obj(SERIESMATCHER);
     return SeriesMatcher_init(self, matchers, offsets);
 }
 
 SeriesMatcher*
-SeriesMatcher_init(SeriesMatcher *self, VArray *matchers, I32Array *offsets) {
+SeriesMatcher_init(SeriesMatcher *self, Vector *matchers, I32Array *offsets) {
     Matcher_init((Matcher*)self);
     SeriesMatcherIVARS *const ivars = SeriesMatcher_IVARS(self);
 
@@ -38,7 +38,7 @@ SeriesMatcher_init(SeriesMatcher *self, VArray *matchers, I32Array *offsets) {
     ivars->tick            = 0;
 
     // Assign.
-    ivars->matchers        = (VArray*)INCREF(matchers);
+    ivars->matchers        = (Vector*)INCREF(matchers);
     ivars->offsets         = (I32Array*)INCREF(offsets);
 
     // Derive.
@@ -72,7 +72,7 @@ SeriesMatcher_Advance_IMP(SeriesMatcher *self, int32_t target) {
                     = ivars->tick + 1 == ivars->num_matchers
                       ? INT32_MAX
                       : I32Arr_Get(ivars->offsets, ivars->tick + 1);
-                ivars->current_matcher = (Matcher*)VA_Fetch(ivars->matchers,
+                ivars->current_matcher = (Matcher*)Vec_Fetch(ivars->matchers,
                                                            ivars->tick);
                 ivars->current_offset = ivars->next_offset;
                 ivars->next_offset = next_offset;

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/SeriesMatcher.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SeriesMatcher.cfh b/core/Lucy/Search/SeriesMatcher.cfh
index 55f1a61..d1c80d4 100644
--- a/core/Lucy/Search/SeriesMatcher.cfh
+++ b/core/Lucy/Search/SeriesMatcher.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
 class Lucy::Search::SeriesMatcher inherits Lucy::Search::Matcher {
 
     I32Array  *offsets;
-    VArray    *matchers;
+    Vector    *matchers;
     Matcher   *current_matcher;
     int32_t    doc_id;
     int32_t    tick;
@@ -30,10 +30,10 @@ class Lucy::Search::SeriesMatcher inherits Lucy::Search::Matcher {
     int32_t    next_offset;
 
     public inert incremented SeriesMatcher*
-    new(VArray *matchers, I32Array *offsets);
+    new(Vector *matchers, I32Array *offsets);
 
     public inert SeriesMatcher*
-    init(SeriesMatcher *self, VArray *matchers, I32Array *offsets);
+    init(SeriesMatcher *self, Vector *matchers, I32Array *offsets);
 
     public int32_t
     Next(SeriesMatcher *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/SortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SortSpec.c b/core/Lucy/Search/SortSpec.c
index 02f12fa..bdd22e2 100644
--- a/core/Lucy/Search/SortSpec.c
+++ b/core/Lucy/Search/SortSpec.c
@@ -28,17 +28,17 @@
 #include "Clownfish/Util/SortUtils.h"
 
 SortSpec*
-SortSpec_new(VArray *rules) {
+SortSpec_new(Vector *rules) {
     SortSpec *self = (SortSpec*)Class_Make_Obj(SORTSPEC);
     return SortSpec_init(self, rules);
 }
 
 SortSpec*
-SortSpec_init(SortSpec *self, VArray *rules) {
+SortSpec_init(SortSpec *self, Vector *rules) {
     SortSpecIVARS *const ivars = SortSpec_IVARS(self);
-    ivars->rules = VA_Clone(rules);
-    for (int32_t i = 0, max = VA_Get_Size(rules); i < max; i++) {
-        SortRule *rule = (SortRule*)VA_Fetch(rules, i);
+    ivars->rules = Vec_Clone(rules);
+    for (int32_t i = 0, max = Vec_Get_Size(rules); i < max; i++) {
+        SortRule *rule = (SortRule*)Vec_Fetch(rules, i);
         CERTIFY(rule, SORTRULE);
     }
     return self;
@@ -54,12 +54,12 @@ SortSpec_Destroy_IMP(SortSpec *self) {
 SortSpec*
 SortSpec_Deserialize_IMP(SortSpec *self, InStream *instream) {
     uint32_t num_rules = InStream_Read_C32(instream);
-    VArray *rules = VA_new(num_rules);
+    Vector *rules = Vec_new(num_rules);
 
     // Add rules.
     for (uint32_t i = 0; i < num_rules; i++) {
         SortRule *blank = (SortRule*)Class_Make_Obj(SORTRULE);
-        VA_Push(rules, (Obj*)SortRule_Deserialize(blank, instream));
+        Vec_Push(rules, (Obj*)SortRule_Deserialize(blank, instream));
     }
     SortSpec_init(self, rules);
     DECREF(rules);
@@ -67,7 +67,7 @@ SortSpec_Deserialize_IMP(SortSpec *self, InStream *instream) {
     return self;
 }
 
-VArray*
+Vector*
 SortSpec_Get_Rules_IMP(SortSpec *self) {
     return SortSpec_IVARS(self)->rules;
 }
@@ -75,10 +75,10 @@ SortSpec_Get_Rules_IMP(SortSpec *self) {
 void
 SortSpec_Serialize_IMP(SortSpec *self, OutStream *target) {
     SortSpecIVARS *const ivars = SortSpec_IVARS(self);
-    uint32_t num_rules = VA_Get_Size(ivars->rules);
+    uint32_t num_rules = Vec_Get_Size(ivars->rules);
     OutStream_Write_C32(target, num_rules);
     for (uint32_t i = 0; i < num_rules; i++) {
-        SortRule *rule = (SortRule*)VA_Fetch(ivars->rules, i);
+        SortRule *rule = (SortRule*)Vec_Fetch(ivars->rules, i);
         SortRule_Serialize(rule, target);
     }
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/SortSpec.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/SortSpec.cfh b/core/Lucy/Search/SortSpec.cfh
index 473aa01..8df077f 100644
--- a/core/Lucy/Search/SortSpec.cfh
+++ b/core/Lucy/Search/SortSpec.cfh
@@ -30,16 +30,16 @@ parcel Lucy;
 
 public class Lucy::Search::SortSpec inherits Clownfish::Obj {
 
-    VArray        *rules;
+    Vector        *rules;
 
     public inert SortSpec*
-    new(VArray *rules);
+    new(Vector *rules);
 
     /**
      * @param rules An array of SortRules.
      */
     public inert SortSpec*
-    init(SortSpec *self, VArray *rules);
+    init(SortSpec *self, Vector *rules);
 
     public incremented SortSpec*
     Deserialize(decremented SortSpec *self, InStream *instream);
@@ -47,7 +47,7 @@ public class Lucy::Search::SortSpec inherits Clownfish::Obj {
     public void
     Serialize(SortSpec *self, OutStream *outstream);
 
-    VArray*
+    Vector*
     Get_Rules(SortSpec *self);
 
     public void

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/TermQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/TermQuery.c b/core/Lucy/Search/TermQuery.c
index 19a898e..8207384 100644
--- a/core/Lucy/Search/TermQuery.c
+++ b/core/Lucy/Search/TermQuery.c
@@ -282,14 +282,14 @@ TermCompiler_Make_Matcher_IMP(TermCompiler *self, SegReader *reader,
     }
 }
 
-VArray*
+Vector*
 TermCompiler_Highlight_Spans_IMP(TermCompiler *self, Searcher *searcher,
                                  DocVector *doc_vec, String *field) {
 
     TermCompilerIVARS *const ivars = TermCompiler_IVARS(self);
     TermQueryIVARS *const parent_ivars
         = TermQuery_IVARS((TermQuery*)ivars->parent);
-    VArray *spans = VA_new(0);
+    Vector *spans = Vec_new(0);
     TermVector *term_vector;
     I32Array *starts, *ends;
     UNUSED_VAR(searcher);
@@ -306,7 +306,7 @@ TermCompiler_Highlight_Spans_IMP(TermCompiler *self, Searcher *searcher,
     for (uint32_t i = 0, max = I32Arr_Get_Size(starts); i < max; i++) {
         int32_t start  = I32Arr_Get(starts, i);
         int32_t length = I32Arr_Get(ends, i) - start;
-        VA_Push(spans,
+        Vec_Push(spans,
                 (Obj*)Span_new(start, length, TermCompiler_Get_Weight(self)));
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/TermQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/TermQuery.cfh b/core/Lucy/Search/TermQuery.cfh
index 92b1b1c..c4fd394 100644
--- a/core/Lucy/Search/TermQuery.cfh
+++ b/core/Lucy/Search/TermQuery.cfh
@@ -99,7 +99,7 @@ class Lucy::Search::TermCompiler inherits Lucy::Search::Compiler {
     public void
     Apply_Norm_Factor(TermCompiler *self, float factor);
 
-    public incremented VArray*
+    public incremented Vector*
     Highlight_Spans(TermCompiler *self, Searcher *searcher,
                     DocVector *doc_vec, String *field);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/TopDocs.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/TopDocs.c b/core/Lucy/Search/TopDocs.c
index 22f8de4..0c7b83b 100644
--- a/core/Lucy/Search/TopDocs.c
+++ b/core/Lucy/Search/TopDocs.c
@@ -27,15 +27,15 @@
 #include "Lucy/Util/Freezer.h"
 
 TopDocs*
-TopDocs_new(VArray *match_docs, uint32_t total_hits) {
+TopDocs_new(Vector *match_docs, uint32_t total_hits) {
     TopDocs *self = (TopDocs*)Class_Make_Obj(TOPDOCS);
     return TopDocs_init(self, match_docs, total_hits);
 }
 
 TopDocs*
-TopDocs_init(TopDocs *self, VArray *match_docs, uint32_t total_hits) {
+TopDocs_init(TopDocs *self, Vector *match_docs, uint32_t total_hits) {
     TopDocsIVARS *const ivars = TopDocs_IVARS(self);
-    ivars->match_docs = (VArray*)INCREF(match_docs);
+    ivars->match_docs = (Vector*)INCREF(match_docs);
     ivars->total_hits = total_hits;
     return self;
 }
@@ -62,7 +62,7 @@ TopDocs_Deserialize_IMP(TopDocs *self, InStream *instream) {
     return self;
 }
 
-VArray*
+Vector*
 TopDocs_Get_Match_Docs_IMP(TopDocs *self) {
     return TopDocs_IVARS(self)->match_docs;
 }
@@ -73,10 +73,10 @@ TopDocs_Get_Total_Hits_IMP(TopDocs *self) {
 }
 
 void
-TopDocs_Set_Match_Docs_IMP(TopDocs *self, VArray *match_docs) {
+TopDocs_Set_Match_Docs_IMP(TopDocs *self, Vector *match_docs) {
     TopDocsIVARS *const ivars = TopDocs_IVARS(self);
     DECREF(ivars->match_docs);
-    ivars->match_docs = (VArray*)INCREF(match_docs);
+    ivars->match_docs = (Vector*)INCREF(match_docs);
 }
 void
 TopDocs_Set_Total_Hits_IMP(TopDocs *self, uint32_t total_hits) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Search/TopDocs.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/TopDocs.cfh b/core/Lucy/Search/TopDocs.cfh
index 69c21d6..2f6e4ee 100644
--- a/core/Lucy/Search/TopDocs.cfh
+++ b/core/Lucy/Search/TopDocs.cfh
@@ -23,24 +23,24 @@ parcel Lucy;
  */
 class Lucy::Search::TopDocs inherits Clownfish::Obj {
 
-    VArray *match_docs;
+    Vector *match_docs;
     uint32_t   total_hits;
 
     inert incremented TopDocs*
-    new(VArray *match_docs, uint32_t total_hits);
+    new(Vector *match_docs, uint32_t total_hits);
 
     inert TopDocs*
-    init(TopDocs *self, VArray *match_docs, uint32_t total_hits);
+    init(TopDocs *self, Vector *match_docs, uint32_t total_hits);
 
     /** Accessor for `match_docs` member.
      */
-    VArray*
+    Vector*
     Get_Match_Docs(TopDocs *self);
 
     /** Setter for `match_docs` member.
      */
     void
-    Set_Match_Docs(TopDocs *self, VArray *match_docs);
+    Set_Match_Docs(TopDocs *self, Vector *match_docs);
 
     /** Accessor for `total_hits` member.
      */

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/CompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.c b/core/Lucy/Store/CompoundFileReader.c
index 556c14b..2add656 100644
--- a/core/Lucy/Store/CompoundFileReader.c
+++ b/core/Lucy/Store/CompoundFileReader.c
@@ -88,12 +88,12 @@ CFReader_do_open(CompoundFileReader *self, Folder *folder) {
 
     // Strip directory name from filepaths for old format.
     if (ivars->format == 1) {
-        VArray *files = Hash_Keys(ivars->records);
+        Vector *files = Hash_Keys(ivars->records);
         String *folder_name = IxFileNames_local_part(Folder_Get_Path(folder));
         size_t folder_name_len = Str_Length(folder_name);
 
-        for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-            String *orig = (String*)VA_Fetch(files, i);
+        for (uint32_t i = 0, max = Vec_Get_Size(files); i < max; i++) {
+            String *orig = (String*)Vec_Fetch(files, i);
             if (Str_Starts_With(orig, folder_name)) {
                 Obj *record = Hash_Delete(ivars->records, orig);
                 size_t offset = folder_name_len + sizeof(CHY_DIR_SEP) - 1;
@@ -290,7 +290,7 @@ CFReaderDH_init(CFReaderDirHandle *self, CompoundFileReader *cf_reader) {
     DirHandle *dh = Folder_Local_Open_Dir(real_folder);
     while (DH_Next(dh)) {
         String *entry = DH_Get_Entry(dh);
-        VA_Push(ivars->elems, (Obj*)Str_Clone(entry));
+        Vec_Push(ivars->elems, (Obj*)Str_Clone(entry));
         DECREF(entry);
     }
     DECREF(dh);
@@ -316,9 +316,9 @@ CFReaderDH_Next_IMP(CFReaderDirHandle *self) {
     CFReaderDirHandleIVARS *const ivars = CFReaderDH_IVARS(self);
     if (ivars->elems) {
         ivars->tick++;
-        if (ivars->tick < (int32_t)VA_Get_Size(ivars->elems)) {
+        if (ivars->tick < (int32_t)Vec_Get_Size(ivars->elems)) {
             String *path = (String*)CERTIFY(
-                                VA_Fetch(ivars->elems, ivars->tick), STRING);
+                                Vec_Fetch(ivars->elems, ivars->tick), STRING);
             DECREF(ivars->entry);
             ivars->entry = (String*)INCREF(path);
             return true;
@@ -335,7 +335,7 @@ bool
 CFReaderDH_Entry_Is_Dir_IMP(CFReaderDirHandle *self) {
     CFReaderDirHandleIVARS *const ivars = CFReaderDH_IVARS(self);
     if (ivars->elems) {
-        String *name = (String*)VA_Fetch(ivars->elems, ivars->tick);
+        String *name = (String*)Vec_Fetch(ivars->elems, ivars->tick);
         if (name) {
             return CFReader_Local_Is_Directory(ivars->cf_reader, name);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/CompoundFileReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.cfh b/core/Lucy/Store/CompoundFileReader.cfh
index d50bff7..fc24d2b 100644
--- a/core/Lucy/Store/CompoundFileReader.cfh
+++ b/core/Lucy/Store/CompoundFileReader.cfh
@@ -93,7 +93,7 @@ class Lucy::Store::CFReaderDirHandle nickname CFReaderDH
     inherits Lucy::Store::DirHandle {
 
     CompoundFileReader *cf_reader;
-    VArray             *elems;
+    Vector             *elems;
     int32_t             tick;
 
     inert incremented CFReaderDirHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/CompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileWriter.c b/core/Lucy/Store/CompoundFileWriter.c
index a30ddad..e4d97e1 100644
--- a/core/Lucy/Store/CompoundFileWriter.c
+++ b/core/Lucy/Store/CompoundFileWriter.c
@@ -96,8 +96,8 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     Folder    *folder       = ivars->folder;
     Hash      *metadata     = Hash_new(0);
     Hash      *sub_files    = Hash_new(0);
-    VArray    *files        = Folder_List(folder, NULL);
-    VArray    *merged       = VA_new(VA_Get_Size(files));
+    Vector    *files        = Folder_List(folder, NULL);
+    Vector    *merged       = Vec_new(Vec_Get_Size(files));
     String    *cf_file      = (String*)SSTR_WRAP_UTF8("cf.dat", 6);
     OutStream *outstream    = Folder_Open_Out(folder, (String*)cf_file);
     bool       rename_success;
@@ -109,9 +109,9 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     Hash_Store_Utf8(metadata, "format", 6,
                     (Obj*)Str_newf("%i32", CFWriter_current_file_format));
 
-    VA_Sort(files);
-    for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-        String *infilename = (String*)VA_Fetch(files, i);
+    Vec_Sort(files);
+    for (uint32_t i = 0, max = Vec_Get_Size(files); i < max; i++) {
+        String *infilename = (String*)Vec_Fetch(files, i);
 
         if (!Str_Ends_With_Utf8(infilename, ".json", 5)) {
             InStream *instream   = Folder_Open_In(folder, infilename);
@@ -131,7 +131,7 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
             Hash_Store_Utf8(file_data, "length", 6,
                             (Obj*)Str_newf("%i64", len));
             Hash_Store(sub_files, infilename, (Obj*)file_data);
-            VA_Push(merged, INCREF(infilename));
+            Vec_Push(merged, INCREF(infilename));
 
             // Add filler NULL bytes so that every sub-file begins on a file
             // position multiple of 8.
@@ -167,8 +167,8 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     DECREF(iter);
     */
     DECREF(sub_files);
-    for (uint32_t i = 0, max = VA_Get_Size(merged); i < max; i++) {
-        String *merged_file = (String*)VA_Fetch(merged, i);
+    for (uint32_t i = 0, max = Vec_Get_Size(merged); i < max; i++) {
+        String *merged_file = (String*)Vec_Fetch(merged, i);
         if (!Folder_Delete(folder, merged_file)) {
             String *mess = MAKE_MESS("Can't delete '%o'", merged_file);
             DECREF(merged);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/FSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSDirHandle.c b/core/Lucy/Store/FSDirHandle.c
index f231471..4840677 100644
--- a/core/Lucy/Store/FSDirHandle.c
+++ b/core/Lucy/Store/FSDirHandle.c
@@ -25,7 +25,7 @@
 
 #include "Lucy/Util/ToolSet.h"
 #include "Clownfish/Err.h"
-#include "Clownfish/VArray.h"
+#include "Clownfish/Vector.h"
 #include "Lucy/Store/FSDirHandle.h"
 
 #ifdef CHY_HAS_SYS_TYPES_H

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/Folder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.c b/core/Lucy/Store/Folder.c
index 4f639e0..d724da0 100644
--- a/core/Lucy/Store/Folder.c
+++ b/core/Lucy/Store/Folder.c
@@ -170,25 +170,25 @@ Folder_Delete_Tree_IMP(Folder *self, String *path) {
                 = Folder_Local_Find_Folder(enclosing_folder, local);
             DirHandle *dh = Folder_Local_Open_Dir(inner_folder);
             if (dh) {
-                VArray *files = VA_new(20);
-                VArray *dirs  = VA_new(20);
+                Vector *files = Vec_new(20);
+                Vector *dirs  = Vec_new(20);
                 while (DH_Next(dh)) {
                     String *entry = DH_Get_Entry(dh);
-                    VA_Push(files, (Obj*)Str_Clone(entry));
+                    Vec_Push(files, (Obj*)Str_Clone(entry));
                     if (DH_Entry_Is_Dir(dh) && !DH_Entry_Is_Symlink(dh)) {
-                        VA_Push(dirs, (Obj*)Str_Clone(entry));
+                        Vec_Push(dirs, (Obj*)Str_Clone(entry));
                     }
                     DECREF(entry);
                 }
-                for (uint32_t i = 0, max = VA_Get_Size(dirs); i < max; i++) {
-                    String *name = (String*)VA_Fetch(files, i);
+                for (uint32_t i = 0, max = Vec_Get_Size(dirs); i < max; i++) {
+                    String *name = (String*)Vec_Fetch(files, i);
                     bool success = Folder_Delete_Tree(inner_folder, name);
                     if (!success && Folder_Local_Exists(inner_folder, name)) {
                         break;
                     }
                 }
-                for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-                    String *name = (String*)VA_Fetch(files, i);
+                for (uint32_t i = 0, max = Vec_Get_Size(files); i < max; i++) {
+                    String *name = (String*)Vec_Fetch(files, i);
                     bool success = Folder_Local_Delete(inner_folder, name);
                     if (!success && Folder_Local_Exists(inner_folder, name)) {
                         break;
@@ -220,7 +220,7 @@ S_is_updir(String *path) {
 }
 
 static void
-S_add_to_file_list(Folder *self, VArray *list, String *dir,
+S_add_to_file_list(Folder *self, Vector *list, String *dir,
                    String *path) {
     DirHandle *dh = Folder_Open_Dir(self, dir);
 
@@ -234,10 +234,10 @@ S_add_to_file_list(Folder *self, VArray *list, String *dir,
             String *relpath = path && Str_Get_Size(path)
                               ? Str_newf("%o/%o", path, entry)
                               : Str_Clone(entry);
-            if (VA_Get_Size(list) == VA_Get_Capacity(list)) {
-                VA_Grow(list, VA_Get_Size(list) * 2);
+            if (Vec_Get_Size(list) == Vec_Get_Capacity(list)) {
+                Vec_Grow(list, Vec_Get_Size(list) * 2);
             }
-            VA_Push(list, (Obj*)relpath);
+            Vec_Push(list, (Obj*)relpath);
 
             if (DH_Entry_Is_Dir(dh) && !DH_Entry_Is_Symlink(dh)) {
                 String *subdir = Str_Get_Size(dir)
@@ -331,16 +331,16 @@ Folder_Is_Directory_IMP(Folder *self, String *path) {
     return retval;
 }
 
-VArray*
+Vector*
 Folder_List_IMP(Folder *self, String *path) {
     Folder *local_folder = Folder_Find_Folder(self, path);
-    VArray *list = NULL;
+    Vector *list = NULL;
     DirHandle *dh = Folder_Local_Open_Dir(local_folder);
     if (dh) {
-        list = VA_new(32);
+        list = Vec_new(32);
         while (DH_Next(dh)) {
             String *entry = DH_Get_Entry(dh);
-            VA_Push(list, (Obj*)Str_Clone(entry));
+            Vec_Push(list, (Obj*)Str_Clone(entry));
             DECREF(entry);
         }
         DECREF(dh);
@@ -351,10 +351,10 @@ Folder_List_IMP(Folder *self, String *path) {
     return list;
 }
 
-VArray*
+Vector*
 Folder_List_R_IMP(Folder *self, String *path) {
     Folder *local_folder = Folder_Find_Folder(self, path);
-    VArray *list =  VA_new(0);
+    Vector *list =  Vec_new(0);
     if (local_folder) {
         String *dir = Str_new_from_trusted_utf8("", 0);
         S_add_to_file_list(local_folder, list, dir, path);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/Folder.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.cfh b/core/Lucy/Store/Folder.cfh
index c38a8f0..a2c1bf0 100644
--- a/core/Lucy/Store/Folder.cfh
+++ b/core/Lucy/Store/Folder.cfh
@@ -101,7 +101,7 @@ public abstract class Lucy::Store::Folder inherits Clownfish::Obj {
      * @param path A relative filepath optionally specifying a subdirectory.
      * @return an unsorted array of filenames.
      */
-    incremented VArray*
+    incremented Vector*
     List(Folder *self, String *path = NULL);
 
     /** Recursively list all files and directories in the Folder.
@@ -109,7 +109,7 @@ public abstract class Lucy::Store::Folder inherits Clownfish::Obj {
      * @param path A relative filepath optionally specifying a subdirectory.
      * @return an unsorted array of relative filepaths.
      */
-    incremented VArray*
+    incremented Vector*
     List_R(Folder *self, String *path = NULL);
 
     /** Indicate whether an entity exists at `path`.

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/RAMDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/RAMDirHandle.c b/core/Lucy/Store/RAMDirHandle.c
index d0261e2..973c0ff 100644
--- a/core/Lucy/Store/RAMDirHandle.c
+++ b/core/Lucy/Store/RAMDirHandle.c
@@ -57,9 +57,9 @@ RAMDH_Next_IMP(RAMDirHandle *self) {
     RAMDirHandleIVARS *const ivars = RAMDH_IVARS(self);
     if (ivars->elems) {
         ivars->tick++;
-        if (ivars->tick < (int32_t)VA_Get_Size(ivars->elems)) {
+        if (ivars->tick < (int32_t)Vec_Get_Size(ivars->elems)) {
             String *path = (String*)CERTIFY(
-                                VA_Fetch(ivars->elems, ivars->tick), STRING);
+                                Vec_Fetch(ivars->elems, ivars->tick), STRING);
             DECREF(ivars->entry);
             ivars->entry = (String*)INCREF(path);
             return true;
@@ -76,7 +76,7 @@ bool
 RAMDH_Entry_Is_Dir_IMP(RAMDirHandle *self) {
     RAMDirHandleIVARS *const ivars = RAMDH_IVARS(self);
     if (ivars->elems) {
-        String *name = (String*)VA_Fetch(ivars->elems, ivars->tick);
+        String *name = (String*)Vec_Fetch(ivars->elems, ivars->tick);
         if (name) {
             return RAMFolder_Local_Is_Directory(ivars->folder, name);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Store/RAMDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/RAMDirHandle.cfh b/core/Lucy/Store/RAMDirHandle.cfh
index 2d9e545..d083509 100644
--- a/core/Lucy/Store/RAMDirHandle.cfh
+++ b/core/Lucy/Store/RAMDirHandle.cfh
@@ -22,7 +22,7 @@ class Lucy::Store::RAMDirHandle nickname RAMDH
     inherits Lucy::Store::DirHandle {
 
     RAMFolder *folder;
-    VArray    *elems;
+    Vector    *elems;
     int32_t    tick;
 
     inert incremented RAMDirHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestAnalyzer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestAnalyzer.c b/core/Lucy/Test/Analysis/TestAnalyzer.c
index ba871fa..6df3223 100644
--- a/core/Lucy/Test/Analysis/TestAnalyzer.c
+++ b/core/Lucy/Test/Analysis/TestAnalyzer.c
@@ -50,8 +50,8 @@ static void
 test_analysis(TestBatchRunner *runner) {
     DummyAnalyzer *analyzer = DummyAnalyzer_new();
     String *source = Str_newf("foo bar baz");
-    VArray *wanted = VA_new(1);
-    VA_Push(wanted, (Obj*)Str_newf("foo bar baz"));
+    Vector *wanted = Vec_new(1);
+    Vec_Push(wanted, (Obj*)Str_newf("foo bar baz"));
     TestUtils_test_analyzer(runner, (Analyzer*)analyzer, source, wanted,
                             "test basic analysis");
     DECREF(wanted);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestCaseFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestCaseFolder.c b/core/Lucy/Test/Analysis/TestCaseFolder.c
index 9a72f96..365ba99 100644
--- a/core/Lucy/Test/Analysis/TestCaseFolder.c
+++ b/core/Lucy/Test/Analysis/TestCaseFolder.c
@@ -52,8 +52,8 @@ static void
 test_analysis(TestBatchRunner *runner) {
     CaseFolder *case_folder = CaseFolder_new();
     String *source = Str_newf("caPiTal ofFensE");
-    VArray *wanted = VA_new(1);
-    VA_Push(wanted, (Obj*)Str_newf("capital offense"));
+    Vector *wanted = Vec_new(1);
+    Vec_Push(wanted, (Obj*)Str_newf("capital offense"));
     TestUtils_test_analyzer(runner, (Analyzer*)case_folder, source, wanted,
                             "lowercase plain text");
     DECREF(wanted);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestNormalizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestNormalizer.c b/core/Lucy/Test/Analysis/TestNormalizer.c
index 3c7cd8a..3b69ce8 100644
--- a/core/Lucy/Test/Analysis/TestNormalizer.c
+++ b/core/Lucy/Test/Analysis/TestNormalizer.c
@@ -74,11 +74,11 @@ static void
 test_normalization(TestBatchRunner *runner) {
     FSFolder *modules_folder = TestUtils_modules_folder();
     String *path = Str_newf("unicode/utf8proc/tests.json");
-    VArray *tests = (VArray*)Json_slurp_json((Folder*)modules_folder, path);
+    Vector *tests = (Vector*)Json_slurp_json((Folder*)modules_folder, path);
     if (!tests) { RETHROW(Err_get_error()); }
 
-    for (uint32_t i = 0, max = VA_Get_Size(tests); i < max; i++) {
-        Hash *test = (Hash*)VA_Fetch(tests, i);
+    for (uint32_t i = 0, max = Vec_Get_Size(tests); i < max; i++) {
+        Hash *test = (Hash*)Vec_Fetch(tests, i);
         String *form = (String*)Hash_Fetch_Utf8(
                             test, "normalization_form", 18);
         bool case_fold = Bool_Get_Value((BoolNum*)Hash_Fetch_Utf8(
@@ -86,16 +86,16 @@ test_normalization(TestBatchRunner *runner) {
         bool strip_accents = Bool_Get_Value((BoolNum*)Hash_Fetch_Utf8(
                                                   test, "strip_accents", 13));
         Normalizer *normalizer = Normalizer_new(form, case_fold, strip_accents);
-        VArray *words = (VArray*)Hash_Fetch_Utf8(test, "words", 5);
-        VArray *norms = (VArray*)Hash_Fetch_Utf8(test, "norms", 5);
-        for (uint32_t j = 0, max = VA_Get_Size(words); j < max; j++) {
-            String *word = (String*)VA_Fetch(words, j);
-            VArray *got  = Normalizer_Split(normalizer, word);
-            String *norm = (String*)VA_Fetch(got, 0);
+        Vector *words = (Vector*)Hash_Fetch_Utf8(test, "words", 5);
+        Vector *norms = (Vector*)Hash_Fetch_Utf8(test, "norms", 5);
+        for (uint32_t j = 0, max = Vec_Get_Size(words); j < max; j++) {
+            String *word = (String*)Vec_Fetch(words, j);
+            Vector *got  = Normalizer_Split(normalizer, word);
+            String *norm = (String*)Vec_Fetch(got, 0);
             TEST_TRUE(runner,
                       norm
                       && Str_Is_A(norm, STRING)
-                      && Str_Equals(norm, VA_Fetch(norms, j)),
+                      && Str_Equals(norm, Vec_Fetch(norms, j)),
                       "Normalize %s %d %d: %s", Str_Get_Ptr8(form),
                       case_fold, strip_accents, Str_Get_Ptr8(word)
                      );

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestPolyAnalyzer.c b/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
index 083eafe..638c72e 100644
--- a/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
+++ b/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
@@ -76,10 +76,10 @@ test_analysis(TestBatchRunner *runner) {
     SnowballStemmer    *stemmer     = SnowStemmer_new(EN);
 
     {
-        VArray       *analyzers    = VA_new(0);
+        Vector       *analyzers    = Vec_new(0);
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
-        VArray       *expected     = VA_new(1);
-        VA_Push(expected, INCREF(source_text));
+        Vector       *expected     = Vec_new(1);
+        Vec_Push(expected, INCREF(source_text));
         TestUtils_test_analyzer(runner, (Analyzer*)polyanalyzer, source_text,
                                 expected, "No sub analyzers");
         DECREF(expected);
@@ -88,11 +88,11 @@ test_analysis(TestBatchRunner *runner) {
     }
 
     {
-        VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(normalizer));
+        Vector       *analyzers    = Vec_new(0);
+        Vec_Push(analyzers, INCREF(normalizer));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
-        VArray       *expected     = VA_new(1);
-        VA_Push(expected, (Obj*)Str_newf("eats, shoots and leaves."));
+        Vector       *expected     = Vec_new(1);
+        Vec_Push(expected, (Obj*)Str_newf("eats, shoots and leaves."));
         TestUtils_test_analyzer(runner, (Analyzer*)polyanalyzer, source_text,
                                 expected, "With Normalizer");
         DECREF(expected);
@@ -101,15 +101,15 @@ test_analysis(TestBatchRunner *runner) {
     }
 
     {
-        VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(normalizer));
-        VA_Push(analyzers, INCREF(tokenizer));
+        Vector       *analyzers    = Vec_new(0);
+        Vec_Push(analyzers, INCREF(normalizer));
+        Vec_Push(analyzers, INCREF(tokenizer));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
-        VArray       *expected     = VA_new(1);
-        VA_Push(expected, (Obj*)Str_newf("eats"));
-        VA_Push(expected, (Obj*)Str_newf("shoots"));
-        VA_Push(expected, (Obj*)Str_newf("and"));
-        VA_Push(expected, (Obj*)Str_newf("leaves"));
+        Vector       *expected     = Vec_new(1);
+        Vec_Push(expected, (Obj*)Str_newf("eats"));
+        Vec_Push(expected, (Obj*)Str_newf("shoots"));
+        Vec_Push(expected, (Obj*)Str_newf("and"));
+        Vec_Push(expected, (Obj*)Str_newf("leaves"));
         TestUtils_test_analyzer(runner, (Analyzer*)polyanalyzer, source_text,
                                 expected, "With StandardTokenizer");
         DECREF(expected);
@@ -118,15 +118,15 @@ test_analysis(TestBatchRunner *runner) {
     }
 
     {
-        VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(normalizer));
-        VA_Push(analyzers, INCREF(tokenizer));
-        VA_Push(analyzers, INCREF(stopfilter));
+        Vector       *analyzers    = Vec_new(0);
+        Vec_Push(analyzers, INCREF(normalizer));
+        Vec_Push(analyzers, INCREF(tokenizer));
+        Vec_Push(analyzers, INCREF(stopfilter));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
-        VArray       *expected     = VA_new(1);
-        VA_Push(expected, (Obj*)Str_newf("eats"));
-        VA_Push(expected, (Obj*)Str_newf("shoots"));
-        VA_Push(expected, (Obj*)Str_newf("leaves"));
+        Vector       *expected     = Vec_new(1);
+        Vec_Push(expected, (Obj*)Str_newf("eats"));
+        Vec_Push(expected, (Obj*)Str_newf("shoots"));
+        Vec_Push(expected, (Obj*)Str_newf("leaves"));
         TestUtils_test_analyzer(runner, (Analyzer*)polyanalyzer, source_text,
                                 expected, "With SnowballStopFilter");
         DECREF(expected);
@@ -135,16 +135,16 @@ test_analysis(TestBatchRunner *runner) {
     }
 
     {
-        VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(normalizer));
-        VA_Push(analyzers, INCREF(tokenizer));
-        VA_Push(analyzers, INCREF(stopfilter));
-        VA_Push(analyzers, INCREF(stemmer));
+        Vector       *analyzers    = Vec_new(0);
+        Vec_Push(analyzers, INCREF(normalizer));
+        Vec_Push(analyzers, INCREF(tokenizer));
+        Vec_Push(analyzers, INCREF(stopfilter));
+        Vec_Push(analyzers, INCREF(stemmer));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
-        VArray       *expected     = VA_new(1);
-        VA_Push(expected, (Obj*)Str_newf("eat"));
-        VA_Push(expected, (Obj*)Str_newf("shoot"));
-        VA_Push(expected, (Obj*)Str_newf("leav"));
+        Vector       *expected     = Vec_new(1);
+        Vec_Push(expected, (Obj*)Str_newf("eat"));
+        Vec_Push(expected, (Obj*)Str_newf("shoot"));
+        Vec_Push(expected, (Obj*)Str_newf("leav"));
         TestUtils_test_analyzer(runner, (Analyzer*)polyanalyzer, source_text,
                                 expected, "With SnowballStemmer");
         DECREF(expected);
@@ -161,7 +161,7 @@ test_analysis(TestBatchRunner *runner) {
 
 static void
 test_Get_Analyzers(TestBatchRunner *runner) {
-    VArray *analyzers = VA_new(0);
+    Vector *analyzers = Vec_new(0);
     PolyAnalyzer *analyzer = PolyAnalyzer_new(NULL, analyzers);
     TEST_TRUE(runner, PolyAnalyzer_Get_Analyzers(analyzer) == analyzers,
               "Get_Analyzers()");

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestSnowballStemmer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStemmer.c b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
index 18e6a78..d1157b6 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStemmer.c
+++ b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
@@ -72,17 +72,17 @@ test_stemming(TestBatchRunner *runner) {
     while (HashIter_Next(iter)) {
         String *iso       = HashIter_Get_Key(iter);
         Hash   *lang_data = (Hash*)HashIter_Get_Value(iter);
-        VArray *words = (VArray*)Hash_Fetch_Utf8(lang_data, "words", 5);
-        VArray *stems = (VArray*)Hash_Fetch_Utf8(lang_data, "stems", 5);
+        Vector *words = (Vector*)Hash_Fetch_Utf8(lang_data, "words", 5);
+        Vector *stems = (Vector*)Hash_Fetch_Utf8(lang_data, "stems", 5);
         SnowballStemmer *stemmer = SnowStemmer_new(iso);
-        for (uint32_t i = 0, max = VA_Get_Size(words); i < max; i++) {
-            String *word  = (String*)VA_Fetch(words, i);
-            VArray *got   = SnowStemmer_Split(stemmer, word);
-            String *stem  = (String*)VA_Fetch(got, 0);
+        for (uint32_t i = 0, max = Vec_Get_Size(words); i < max; i++) {
+            String *word  = (String*)Vec_Fetch(words, i);
+            Vector *got   = SnowStemmer_Split(stemmer, word);
+            String *stem  = (String*)Vec_Fetch(got, 0);
             TEST_TRUE(runner,
                       stem
                       && Str_Is_A(stem, STRING)
-                      && Str_Equals(stem, VA_Fetch(stems, i)),
+                      && Str_Equals(stem, Vec_Fetch(stems, i)),
                       "Stem %s: %s", Str_Get_Ptr8(iso), Str_Get_Ptr8(word)
                      );
             DECREF(got);

http://git-wip-us.apache.org/repos/asf/lucy/blob/0c238b13/core/Lucy/Test/Analysis/TestStandardTokenizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestStandardTokenizer.c b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
index b0dcf77..918e184 100644
--- a/core/Lucy/Test/Analysis/TestStandardTokenizer.c
+++ b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
@@ -61,32 +61,32 @@ test_tokenizer(TestBatchRunner *runner) {
                               "a"
                               "/",
                               35);
-    VArray *got = StandardTokenizer_Split(tokenizer, (String*)word);
-    String *token = (String*)VA_Fetch(got, 0);
+    Vector *got = StandardTokenizer_Split(tokenizer, (String*)word);
+    String *token = (String*)Vec_Fetch(got, 0);
     TEST_TRUE(runner,
               token
               && Str_Is_A(token, STRING)
               && Str_Equals_Utf8(token, "tha\xcc\x82t's", 8),
               "Token: %s", Str_Get_Ptr8(token));
-    token = (String*)VA_Fetch(got, 1);
+    token = (String*)Vec_Fetch(got, 1);
     TEST_TRUE(runner,
               token
               && Str_Is_A(token, STRING)
               && Str_Equals_Utf8(token, "1,02\xC2\xADZ4.38", 11),
               "Token: %s", Str_Get_Ptr8(token));
-    token = (String*)VA_Fetch(got, 2);
+    token = (String*)Vec_Fetch(got, 2);
     TEST_TRUE(runner,
               token
               && Str_Is_A(token, STRING)
               && Str_Equals_Utf8(token, "\xE0\xB8\x81\xC2\xAD\xC2\xAD", 7),
               "Token: %s", Str_Get_Ptr8(token));
-    token = (String*)VA_Fetch(got, 3);
+    token = (String*)Vec_Fetch(got, 3);
     TEST_TRUE(runner,
               token
               && Str_Is_A(token, STRING)
               && Str_Equals_Utf8(token, "\xF0\xA0\x80\x80", 4),
               "Token: %s", Str_Get_Ptr8(token));
-    token = (String*)VA_Fetch(got, 4);
+    token = (String*)Vec_Fetch(got, 4);
     TEST_TRUE(runner,
               token
               && Str_Is_A(token, STRING)
@@ -96,15 +96,15 @@ test_tokenizer(TestBatchRunner *runner) {
 
     FSFolder *modules_folder = TestUtils_modules_folder();
     String *path = Str_newf("unicode/ucd/WordBreakTest.json");
-    VArray *tests = (VArray*)Json_slurp_json((Folder*)modules_folder, path);
+    Vector *tests = (Vector*)Json_slurp_json((Folder*)modules_folder, path);
     if (!tests) { RETHROW(Err_get_error()); }
 
-    for (uint32_t i = 0, max = VA_Get_Size(tests); i < max; i++) {
-        Hash *test = (Hash*)VA_Fetch(tests, i);
+    for (uint32_t i = 0, max = Vec_Get_Size(tests); i < max; i++) {
+        Hash *test = (Hash*)Vec_Fetch(tests, i);
         String *text = (String*)Hash_Fetch_Utf8(test, "text", 4);
-        VArray *wanted = (VArray*)Hash_Fetch_Utf8(test, "words", 5);
-        VArray *got = StandardTokenizer_Split(tokenizer, text);
-        TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "UCD test #%d", i + 1);
+        Vector *wanted = (Vector*)Hash_Fetch_Utf8(test, "words", 5);
+        Vector *got = StandardTokenizer_Split(tokenizer, text);
+        TEST_TRUE(runner, Vec_Equals(wanted, (Obj*)got), "UCD test #%d", i + 1);
         DECREF(got);
     }
 


Mime
View raw message