You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2016/02/06 15:17:34 UTC

[01/14] lucy-clownfish git commit: Mark Class_Get_Parent as nullable

Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 9fd7fb5bf -> c75ee9248


Mark Class_Get_Parent as nullable


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/dd89ccf9
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/dd89ccf9
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/dd89ccf9

Branch: refs/heads/master
Commit: dd89ccf93b7227e8c7173d2e8b8e601519c1ce6d
Parents: fe854dd
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jan 11 18:02:03 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:24:28 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Class.cfh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/dd89ccf9/runtime/core/Clownfish/Class.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh
index f72d1a3..3c5b37b 100644
--- a/runtime/core/Clownfish/Class.cfh
+++ b/runtime/core/Clownfish/Class.cfh
@@ -121,7 +121,7 @@ public final class Clownfish::Class inherits Clownfish::Obj {
     public String*
     Get_Name(Class *self);
 
-    public Class*
+    public nullable Class*
     Get_Parent(Class *self);
 
     uint32_t


[03/14] lucy-clownfish git commit: Make Blob ctors take void pointers

Posted by nw...@apache.org.
Make Blob ctors take void pointers


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/39385c5d
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/39385c5d
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/39385c5d

Branch: refs/heads/master
Commit: 39385c5d203a92cc33023fe797f3b19bd8937e5c
Parents: 9fd7fb5
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jan 11 17:39:08 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:24:28 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Blob.c     | 24 ++++++++++++------------
 runtime/core/Clownfish/Blob.cfh   | 12 ++++++------
 runtime/go/clownfish/clownfish.go |  8 ++++----
 3 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/39385c5d/runtime/core/Clownfish/Blob.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Blob.c b/runtime/core/Clownfish/Blob.c
index 3e37e0c..dec4954 100644
--- a/runtime/core/Clownfish/Blob.c
+++ b/runtime/core/Clownfish/Blob.c
@@ -25,16 +25,16 @@
 #include "Clownfish/Util/Memory.h"
 
 Blob*
-Blob_new(const char *buf, size_t size) {
+Blob_new(const void *bytes, size_t size) {
     Blob *self = (Blob*)Class_Make_Obj(BLOB);
-    return Blob_init(self, buf, size);
+    return Blob_init(self, bytes, size);
 }
 
 Blob*
-Blob_init(Blob *self, const char *buf, size_t size) {
+Blob_init(Blob *self, const void *bytes, size_t size) {
     char *copy = (char*)MALLOCATE(size);
     if (size > 0) {
-        memcpy(copy, buf, size);
+        memcpy(copy, bytes, size);
     }
 
     self->buf      = copy;
@@ -45,14 +45,14 @@ Blob_init(Blob *self, const char *buf, size_t size) {
 }
 
 Blob*
-Blob_new_steal(char *buf, size_t size) {
+Blob_new_steal(void *bytes, size_t size) {
     Blob *self = (Blob*)Class_Make_Obj(BLOB);
-    return Blob_init_steal(self, buf, size);
+    return Blob_init_steal(self, bytes, size);
 }
 
 Blob*
-Blob_init_steal(Blob *self, char *buf, size_t size) {
-    self->buf      = buf;
+Blob_init_steal(Blob *self, void *bytes, size_t size) {
+    self->buf      = (char*)bytes;
     self->size     = size;
     self->owns_buf = true;
 
@@ -60,14 +60,14 @@ Blob_init_steal(Blob *self, char *buf, size_t size) {
 }
 
 Blob*
-Blob_new_wrap(const char *buf, size_t size) {
+Blob_new_wrap(const void *bytes, size_t size) {
     Blob *self = (Blob*)Class_Make_Obj(BLOB);
-    return Blob_init_wrap(self, buf, size);
+    return Blob_init_wrap(self, bytes, size);
 }
 
 Blob*
-Blob_init_wrap(Blob *self, const char *buf, size_t size) {
-    self->buf      = buf;
+Blob_init_wrap(Blob *self, const void *bytes, size_t size) {
+    self->buf      = (char*)bytes;
     self->size     = size;
     self->owns_buf = false;
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/39385c5d/runtime/core/Clownfish/Blob.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Blob.cfh b/runtime/core/Clownfish/Blob.cfh
index 9832c5f..fce8379 100644
--- a/runtime/core/Clownfish/Blob.cfh
+++ b/runtime/core/Clownfish/Blob.cfh
@@ -27,22 +27,22 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
     bool        owns_buf;
 
     public inert incremented Blob*
-    new(const char *buf, size_t size);
+    new(const void *bytes, size_t size);
 
     public inert Blob*
-    init(Blob *self, const char *buf, size_t size);
+    init(Blob *self, const void *bytes, size_t size);
 
     public inert incremented Blob*
-    new_steal(char *buf, size_t size);
+    new_steal(void *bytes, size_t size);
 
     public inert Blob*
-    init_steal(Blob *self, char *buf, size_t size);
+    init_steal(Blob *self, void *bytes, size_t size);
 
     public inert incremented Blob*
-    new_wrap(const char *buf, size_t size);
+    new_wrap(const void *bytes, size_t size);
 
     public inert Blob*
-    init_wrap(Blob *self, const char *buf, size_t size);
+    init_wrap(Blob *self, const void *bytes, size_t size);
 
     void*
     To_Host(Blob *self);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/39385c5d/runtime/go/clownfish/clownfish.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/clownfish.go b/runtime/go/clownfish/clownfish.go
index 96bbf35..4a2ed77 100644
--- a/runtime/go/clownfish/clownfish.go
+++ b/runtime/go/clownfish/clownfish.go
@@ -349,9 +349,9 @@ func goToBlob(value interface{}, nullable bool) unsafe.Pointer {
 			}
 		} else {
 			size := C.size_t(len(v))
-			var buf *C.char = nil
+			var buf unsafe.Pointer = nil
 			if size > 0 {
-				buf = ((*C.char)(unsafe.Pointer(&v[0])))
+				buf = unsafe.Pointer(&v[0])
 			}
 			return unsafe.Pointer(C.cfish_Blob_new(buf, size))
 		}
@@ -665,9 +665,9 @@ func NewBoolean(val bool) Boolean {
 
 func NewBlob(content []byte) Blob {
 	size := C.size_t(len(content))
-	var buf *C.char = nil
+	var buf unsafe.Pointer = nil
 	if size > 0 {
-		buf = ((*C.char)(unsafe.Pointer(&content[0])))
+		buf = unsafe.Pointer(&content[0])
 	}
 	obj := C.cfish_Blob_new(buf, size)
 	return WRAPBlob(unsafe.Pointer(obj))


[11/14] lucy-clownfish git commit: Another round of documentation fixes

Posted by nw...@apache.org.
Another round of documentation fixes


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fe3b37bd
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fe3b37bd
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fe3b37bd

Branch: refs/heads/master
Commit: fe3b37bdd386090bd908ee4862cc5e82138909ab
Parents: 6210eac
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Feb 4 13:27:06 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Feb 4 14:33:30 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/ByteBuf.cfh |  2 +-
 runtime/core/Clownfish/CharBuf.cfh | 12 ++++++------
 runtime/core/Clownfish/Err.cfh     |  2 ++
 runtime/core/Clownfish/Hash.cfh    |  2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe3b37bd/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/ByteBuf.cfh b/runtime/core/Clownfish/ByteBuf.cfh
index a86bbb2..f07c3de 100644
--- a/runtime/core/Clownfish/ByteBuf.cfh
+++ b/runtime/core/Clownfish/ByteBuf.cfh
@@ -123,7 +123,7 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     public nullable char*
     Grow(ByteBuf *self, size_t capacity);
 
-    /** Return the content of the ByteBuf as ()[Blob] and clear the ByteBuf.
+    /** Return the content of the ByteBuf as [](Blob) and clear the ByteBuf.
      */
     public incremented Blob*
     Yield_Blob(ByteBuf *self);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe3b37bd/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index 1270a2d..07faab7 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -69,14 +69,14 @@ public final class Clownfish::CharBuf nickname CB
     /** Concatenate formatted arguments.  Similar to the printf family, but
      * only accepts minimal options (just enough for decent error messages).
      *
-     * Objects:  %o
-     * char*:    %s
-     * integers: %i8 %i32 %i64 %u8 %u32 %u64
-     * floats:   %f64
-     * hex:      %x32
+     *     Objects:  %o
+     *     char*:    %s
+     *     integers: %i8 %i32 %i64 %u8 %u32 %u64
+     *     floats:   %f64
+     *     hex:      %x32
      *
      * Note that all Clownfish Objects, including Strings, are printed via
-     * %o (which invokes [](Obj.To_String)).
+     * `%o` (which invokes [](Obj.To_String)).
      *
      * @param pattern The format string.
      * @param args A `va_list` containing the arguments.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe3b37bd/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Err.cfh b/runtime/core/Clownfish/Err.cfh
index e6dce87..c05abb2 100644
--- a/runtime/core/Clownfish/Err.cfh
+++ b/runtime/core/Clownfish/Err.cfh
@@ -60,6 +60,8 @@ public class Clownfish::Err inherits Clownfish::Obj {
     public void
     Cat_Mess(Err *self, String *mess);
 
+    /** Return the error message.
+     */
     public String*
     Get_Mess(Err *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe3b37bd/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Hash.cfh b/runtime/core/Clownfish/Hash.cfh
index b2fa243..473ad15 100644
--- a/runtime/core/Clownfish/Hash.cfh
+++ b/runtime/core/Clownfish/Hash.cfh
@@ -67,7 +67,7 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
      *
      * @param utf8 Pointer to UTF-8 character data of the key.
      * @param size Size of UTF-8 character data in bytes.
-     * @param The Obj to store.
+     * @param value The Obj to store.
      */
     public void
     Store_Utf8(Hash *self, const char *utf8, size_t size,


[14/14] lucy-clownfish git commit: Merge branch 'documentation-and-misc-fixes'

Posted by nw...@apache.org.
Merge branch 'documentation-and-misc-fixes'

Closes #54.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/c75ee924
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/c75ee924
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/c75ee924

Branch: refs/heads/master
Commit: c75ee92481f8182db35877af868c2fbc98a03c21
Parents: 9fd7fb5 14e8a24
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Feb 6 15:08:18 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Feb 6 15:08:18 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Blob.c                   |  24 +--
 runtime/core/Clownfish/Blob.cfh                 |  66 +++++--
 runtime/core/Clownfish/Boolean.cfh              |  14 +-
 runtime/core/Clownfish/ByteBuf.cfh              |  78 +++++---
 runtime/core/Clownfish/CharBuf.cfh              |  67 ++++---
 runtime/core/Clownfish/Class.cfh                |  15 +-
 runtime/core/Clownfish/Err.cfh                  |  20 ++-
 runtime/core/Clownfish/Hash.cfh                 |  47 ++++-
 runtime/core/Clownfish/HashIterator.cfh         |  25 ++-
 runtime/core/Clownfish/Num.cfh                  |  62 ++++++-
 runtime/core/Clownfish/Obj.cfh                  |  12 +-
 runtime/core/Clownfish/String.cfh               | 178 +++++++++++++++----
 runtime/core/Clownfish/Test/TestString.c        |   6 +-
 .../core/Clownfish/Test/Util/TestStringHelper.c |   4 +-
 runtime/core/Clownfish/Util/Memory.cfh          |  12 +-
 runtime/core/Clownfish/Util/StringHelper.c      |   1 -
 runtime/core/Clownfish/Vector.cfh               |  36 ++--
 runtime/go/clownfish/class_test.go              |   2 +-
 runtime/go/clownfish/clownfish.go               |   8 +-
 .../perl/buildlib/Clownfish/Build/Binding.pm    |  48 +++--
 20 files changed, 544 insertions(+), 181 deletions(-)
----------------------------------------------------------------------



[06/14] lucy-clownfish git commit: Make Class_Get_Obj_Alloc_Size public

Posted by nw...@apache.org.
Make Class_Get_Obj_Alloc_Size public


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/b8c722be
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/b8c722be
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/b8c722be

Branch: refs/heads/master
Commit: b8c722be6df11b896765a3d6dff74e7b53ab3d7c
Parents: dd89ccf
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jan 11 18:03:30 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:35:36 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Class.cfh   | 2 +-
 runtime/go/clownfish/class_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8c722be/runtime/core/Clownfish/Class.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh
index 3c5b37b..7b43e1b 100644
--- a/runtime/core/Clownfish/Class.cfh
+++ b/runtime/core/Clownfish/Class.cfh
@@ -124,7 +124,7 @@ public final class Clownfish::Class inherits Clownfish::Obj {
     public nullable Class*
     Get_Parent(Class *self);
 
-    uint32_t
+    public uint32_t
     Get_Obj_Alloc_Size(Class *self);
 
     /** Return novel methods of the class.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8c722be/runtime/go/clownfish/class_test.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/class_test.go b/runtime/go/clownfish/class_test.go
index 1099452..ebd3a68 100644
--- a/runtime/go/clownfish/class_test.go
+++ b/runtime/go/clownfish/class_test.go
@@ -37,7 +37,7 @@ func TestClassGetParent(t *testing.T) {
 func TestClassGetObjAllocSize(t *testing.T) {
 	intClass := FetchClass("Clownfish::Integer")
 	classClass := FetchClass("Clownfish::Class")
-	if intClass.getObjAllocSize() >= classClass.getObjAllocSize() {
+	if intClass.GetObjAllocSize() >= classClass.GetObjAllocSize() {
 		t.Error("Unexpected result for getObjAllocSize")
 	}
 }


[13/14] lucy-clownfish git commit: Move Destroy methods to the bottom

Posted by nw...@apache.org.
Move Destroy methods to the bottom

We should think about making Destroy non-public. This method shouldn't
be called directly.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/14e8a24d
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/14e8a24d
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/14e8a24d

Branch: refs/heads/master
Commit: 14e8a24dae05dd3560b715a8a04e24a76c5d7cf2
Parents: a452c42
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Feb 4 14:06:52 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Feb 4 14:35:13 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Boolean.cfh |  6 +++---
 runtime/core/Clownfish/CharBuf.cfh |  6 +++---
 runtime/core/Clownfish/Err.cfh     |  6 +++---
 runtime/core/Clownfish/Obj.cfh     | 12 ++++++------
 runtime/core/Clownfish/String.cfh  |  6 +++---
 5 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/14e8a24d/runtime/core/Clownfish/Boolean.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Boolean.cfh b/runtime/core/Clownfish/Boolean.cfh
index 17d637e..36a7d28 100644
--- a/runtime/core/Clownfish/Boolean.cfh
+++ b/runtime/core/Clownfish/Boolean.cfh
@@ -38,9 +38,6 @@ public final class Clownfish::Boolean nickname Bool {
     public inert Boolean*
     singleton(bool value);
 
-    public void
-    Destroy(Boolean *self);
-
     void*
     To_Host(Boolean *self);
 
@@ -64,6 +61,9 @@ public final class Clownfish::Boolean nickname Bool {
      */
     public incremented String*
     To_String(Boolean *self);
+
+    public void
+    Destroy(Boolean *self);
 }
 
 __C__

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/14e8a24d/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index e4ab770..6c643f4 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -121,9 +121,6 @@ public final class Clownfish::CharBuf nickname CB
     public incremented CharBuf*
     Clone(CharBuf *self);
 
-    public void
-    Destroy(CharBuf *self);
-
     /** Return the content of the CharBuf as String.
      */
     public incremented String*
@@ -134,6 +131,9 @@ public final class Clownfish::CharBuf nickname CB
      */
     public incremented String*
     Yield_String(CharBuf *self);
+
+    public void
+    Destroy(CharBuf *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/14e8a24d/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Err.cfh b/runtime/core/Clownfish/Err.cfh
index 8136caa..d825fcf 100644
--- a/runtime/core/Clownfish/Err.cfh
+++ b/runtime/core/Clownfish/Err.cfh
@@ -49,9 +49,6 @@ public class Clownfish::Err inherits Clownfish::Obj {
     inert Err*
     init(Err *self, decremented String *mess);
 
-    public void
-    Destroy(Err *self);
-
     /** Return a copy of the error message.
      */
     public incremented String*
@@ -72,6 +69,9 @@ public class Clownfish::Err inherits Clownfish::Obj {
     void
     Add_Frame(Err *self, const char *file, int line, const char *func);
 
+    public void
+    Destroy(Err *self);
+
     /** Set the global error object, a per-thread Err shared variable.
      */
     public inert void

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/14e8a24d/runtime/core/Clownfish/Obj.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Obj.cfh b/runtime/core/Clownfish/Obj.cfh
index 89c3dc9..30b14e0 100644
--- a/runtime/core/Clownfish/Obj.cfh
+++ b/runtime/core/Clownfish/Obj.cfh
@@ -38,12 +38,6 @@ public abstract class Clownfish::Obj {
     public abstract incremented Obj*
     Clone(Obj *self);
 
-    /** Generic destructor.  Frees the struct itself but not any complex
-     * member elements.
-     */
-    public void
-    Destroy(Obj *self);
-
     /** Indicate whether two objects are the same.  By default, compares the
      * memory address.
      *
@@ -63,6 +57,12 @@ public abstract class Clownfish::Obj {
     public abstract int32_t
     Compare_To(Obj *self, Obj *other);
 
+    /** Generic destructor.  Frees the struct itself but not any complex
+     * member elements.
+     */
+    public void
+    Destroy(Obj *self);
+
     /** Return the object's Class.
      */
     public inert Class*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/14e8a24d/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh
index 6479930..dca2109 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -292,9 +292,6 @@ public final class Clownfish::String nickname Str
     bool
     Is_Copy_On_IncRef(String *self);
 
-    public void
-    Destroy(String *self);
-
     /** Indicate whether one String is less than, equal to, or greater than
      * another.  The Unicode code points of the Strings are compared
      * lexicographically.  Throws an exception if `other` is not a String.
@@ -363,6 +360,9 @@ public final class Clownfish::String nickname Str
      */
     public incremented StringIterator*
     Tail(String *self);
+
+    public void
+    Destroy(String *self);
 }
 
 /**


[10/14] lucy-clownfish git commit: Document Equals and Compare_To methods in each class

Posted by nw...@apache.org.
Document Equals and Compare_To methods in each class


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/08ccc759
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/08ccc759
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/08ccc759

Branch: refs/heads/master
Commit: 08ccc759fc672c79ace5d346da39b495c7170e8b
Parents: fe3b37b
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Feb 4 13:55:58 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Feb 4 14:33:30 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Blob.cfh    | 17 ++++++++++++++---
 runtime/core/Clownfish/Boolean.cfh |  4 ++++
 runtime/core/Clownfish/ByteBuf.cfh | 18 +++++++++++++++---
 runtime/core/Clownfish/Hash.cfh    |  6 ++++++
 runtime/core/Clownfish/Num.cfh     | 14 ++++++++------
 runtime/core/Clownfish/String.cfh  | 32 +++++++++++++++++++++++++++++---
 runtime/core/Clownfish/Vector.cfh  |  5 +++++
 7 files changed, 81 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/Blob.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Blob.cfh b/runtime/core/Clownfish/Blob.cfh
index 0fa3028..9d21a31 100644
--- a/runtime/core/Clownfish/Blob.cfh
+++ b/runtime/core/Clownfish/Blob.cfh
@@ -89,6 +89,13 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
     public const char*
     Get_Buf(Blob *self);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a Blob and has the same content as `self`.
+     */
+    public bool
+    Equals(Blob *self, Obj *other);
+
     /** Test whether the Blob matches the passed-in bytes.
      *
      * @param bytes Pointer to an array of bytes.
@@ -97,6 +104,13 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
     public bool
     Equals_Bytes(Blob *self, const void *bytes, size_t size);
 
+    /** Indicate whether one Blob is less than, equal to, or greater than
+     * another.  The byte contents of the Blobs are compared
+     * lexicographically.  Throws an exception if `other` is not a Blob.
+     *
+     * @return 0 if the Blobs are equal, a negative number if `self` is less
+     * than `other`, and a positive number if `self` is greater than `other`.
+     */
     public int32_t
     Compare_To(Blob *self, Obj *other);
 
@@ -105,9 +119,6 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
 
     public void
     Destroy(Blob *self);
-
-    public bool
-    Equals(Blob *self, Obj *other);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/Boolean.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Boolean.cfh b/runtime/core/Clownfish/Boolean.cfh
index 6d389db..453b414 100644
--- a/runtime/core/Clownfish/Boolean.cfh
+++ b/runtime/core/Clownfish/Boolean.cfh
@@ -53,6 +53,10 @@ public final class Clownfish::Boolean nickname Bool {
     public incremented Boolean*
     Clone(Boolean *self);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a Boolean with the same value as `self`.
+     */
     public bool
     Equals(Boolean *self, Obj *other);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/ByteBuf.cfh b/runtime/core/Clownfish/ByteBuf.cfh
index f07c3de..5e60ed3 100644
--- a/runtime/core/Clownfish/ByteBuf.cfh
+++ b/runtime/core/Clownfish/ByteBuf.cfh
@@ -140,6 +140,13 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     public incremented String*
     Trusted_Utf8_To_String(ByteBuf *self);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a ByteBuf with the same content as `self`.
+     */
+    public bool
+    Equals(ByteBuf *self, Obj *other);
+
     /** Test whether the ByteBuf matches the passed-in bytes.
      *
      * @param bytes Pointer to an array of bytes.
@@ -148,6 +155,14 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     public bool
     Equals_Bytes(ByteBuf *self, const void *bytes, size_t size);
 
+    /** Indicate whether one ByteBuf is less than, equal to, or greater than
+     * another.  The byte contents of the ByteBufs are compared
+     * lexicographically.  Throws an exception if `other` is not a ByteBuf.
+     *
+     * @return 0 if the ByteBufs are equal, a negative number if `self` is
+     * less than `other`, and a positive number if `self` is greater than
+     * `other`.
+     */
     public int32_t
     Compare_To(ByteBuf *self, Obj *other);
 
@@ -156,9 +171,6 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
 
     public void
     Destroy(ByteBuf *self);
-
-    public bool
-    Equals(ByteBuf *self, Obj *other);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Hash.cfh b/runtime/core/Clownfish/Hash.cfh
index 473ad15..320138d 100644
--- a/runtime/core/Clownfish/Hash.cfh
+++ b/runtime/core/Clownfish/Hash.cfh
@@ -130,6 +130,12 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     public size_t
     Get_Size(Hash *self);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a Hash with the same key-value pairs as
+     * `self`.  Keys and values are compared using their respective `Equals`
+     * methods.
+     */
     public bool
     Equals(Hash *self, Obj *other);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/Num.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Num.cfh b/runtime/core/Clownfish/Num.cfh
index 0f74f9d..d32787c 100644
--- a/runtime/core/Clownfish/Num.cfh
+++ b/runtime/core/Clownfish/Num.cfh
@@ -55,15 +55,16 @@ public final class Clownfish::Float {
 
     /** Indicate whether two numbers are the same.
      *
-     * @param other A Float or an Integer.
+     * @return true if `other` is a Float or Integer with the same value as
+     * `self`.
      */
     public bool
     Equals(Float *self, Obj *other);
 
     /** Indicate whether one number is less than, equal to, or greater than
-     * another.
+     * another.  Throws an exception if `other` is neither a Float nor an
+     * Integer.
      *
-     * @param other A Float or an Integer.
      * @return 0 if the numbers are equal, a negative number if `self` is
      * less than `other`, and a positive number if `self` is greater than
      * `other`.
@@ -114,15 +115,16 @@ public final class Clownfish::Integer nickname Int {
 
     /** Indicate whether two numbers are the same.
      *
-     * @param other An Integer or a Float.
+     * @return true if `other` is an Integer or Float with the same value as
+     * `self`.
      */
     public bool
     Equals(Integer *self, Obj *other);
 
     /** Indicate whether one number is less than, equal to, or greater than
-     * another.
+     * another.  Throws an exception if `other` is neither an Integer nor a
+     * Float.
      *
-     * @param other An Integer or a Float.
      * @return 0 if the numbers are equal, a negative number if `self` is
      * less than `other`, and a positive number if `self` is greater than
      * `other`.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh
index 3d7ba5d..6272a1a 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -245,6 +245,14 @@ public final class Clownfish::String nickname Str
     public incremented nullable StringIterator*
     Find_Utf8(String *self, const char *utf8, size_t size);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a String with the same character data as
+     * `self`.
+     */
+    public bool
+    Equals(String *self, Obj *other);
+
     /** Test whether the String matches the supplied UTF-8 character data.
      */
     public bool
@@ -287,9 +295,13 @@ public final class Clownfish::String nickname Str
     public void
     Destroy(String *self);
 
-    public bool
-    Equals(String *self, Obj *other);
-
+    /** Indicate whether one String is less than, equal to, or greater than
+     * another.  The Unicode code points of the Strings are compared
+     * lexicographically.  Throws an exception if `other` is not a String.
+     *
+     * @return 0 if the Strings are equal, a negative number if `self` is less
+     * than `other`, and a positive number if `self` is greater than `other`.
+     */
     public int32_t
     Compare_To(String *self, Obj *other);
 
@@ -380,9 +392,23 @@ public final class Clownfish::StringIterator nickname StrIter
     public void
     Assign(StringIterator *self, StringIterator *other);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a StringIterator with the same source
+     * string and character position as `self`.
+     */
     public bool
     Equals(StringIterator *self, Obj *other);
 
+    /** Indicate whether one StringIterator is less than, equal to, or
+     * greater than another by comparing their character positions. Throws an
+     * exception if `other` is not a StringIterator pointing to the same
+     * source string as `self`.
+     *
+     * @return 0 if the StringIterators are equal, a negative number if `self`
+     * is less than `other`, and a positive number if `self` is greater than
+     * `other`.
+     */
     public int32_t
     Compare_To(StringIterator *self, Obj *other);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/08ccc759/runtime/core/Clownfish/Vector.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Vector.cfh b/runtime/core/Clownfish/Vector.cfh
index 3f902f9..b671261 100644
--- a/runtime/core/Clownfish/Vector.cfh
+++ b/runtime/core/Clownfish/Vector.cfh
@@ -148,6 +148,11 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     public incremented Vector*
     Slice(Vector *self, size_t offset, size_t length);
 
+    /** Equality test.
+     *
+     * @return true if `other` is a Vector with the same values as `self`.
+     * Values are compared using their respective `Equals` methods.
+     */
     public bool
     Equals(Vector *self, Obj *other);
 


[02/14] lucy-clownfish git commit: Harmonize name and default of capacity params

Posted by nw...@apache.org.
Harmonize name and default of capacity params


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fe854dd6
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fe854dd6
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fe854dd6

Branch: refs/heads/master
Commit: fe854dd69820e91e9d670a1b9a313326219f53a5
Parents: 39385c5
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jan 11 17:54:59 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:24:28 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/ByteBuf.cfh | 6 +++---
 runtime/core/Clownfish/CharBuf.cfh | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe854dd6/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/ByteBuf.cfh b/runtime/core/Clownfish/ByteBuf.cfh
index 217d075..8e25d6c 100644
--- a/runtime/core/Clownfish/ByteBuf.cfh
+++ b/runtime/core/Clownfish/ByteBuf.cfh
@@ -30,10 +30,10 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
      * @param capacity initial capacity of the ByteBuf, in bytes.
      */
     public inert incremented ByteBuf*
-    new(size_t capacity);
+    new(size_t capacity = 0);
 
     public inert ByteBuf*
-    init(ByteBuf *self, size_t capacity);
+    init(ByteBuf *self, size_t capacity = 0);
 
     /** Return a pointer to a new ByteBuf which holds a copy of the passed-in
      * bytes.
@@ -98,7 +98,7 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
      * @return a pointer to the raw buffer.
      */
     public nullable char*
-    Grow(ByteBuf *self, size_t size);
+    Grow(ByteBuf *self, size_t capacity);
 
     /** Return the content of the ByteBuf as Blob and clear the ByteBuf.
      */

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe854dd6/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index e8a2e60..20af51f 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -28,10 +28,10 @@ public final class Clownfish::CharBuf nickname CB
     size_t   cap;  /* allocated bytes, including terminating null */
 
     public inert incremented CharBuf*
-    new(size_t size = 0);
+    new(size_t capacity = 0);
 
     public inert CharBuf*
-    init(CharBuf *self, size_t size = 0);
+    init(CharBuf *self, size_t capacity = 0);
 
     /** Concatenate the passed-in string onto the end of the CharBuf.
      */
@@ -81,7 +81,7 @@ public final class Clownfish::CharBuf nickname CB
      * allocation.
      */
     public void
-    Grow(CharBuf *self, size_t size);
+    Grow(CharBuf *self, size_t capacity);
 
     /** Clear the CharBuf.
      */


[04/14] lucy-clownfish git commit: Mongolian Vowel Separator isn't whitespace

Posted by nw...@apache.org.
Mongolian Vowel Separator isn't whitespace

The character U+180E Mongolian Vowel Separator isn't whitespace since
Unicode 6.3.0.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/a8ca118b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/a8ca118b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/a8ca118b

Branch: refs/heads/master
Commit: a8ca118b84fd0ac10ecb870aa74198caf4b72352
Parents: 814aea8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Feb 3 14:22:47 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:35:36 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Test/TestString.c            | 6 +++---
 runtime/core/Clownfish/Test/Util/TestStringHelper.c | 4 +---
 runtime/core/Clownfish/Util/StringHelper.c          | 1 -
 3 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a8ca118b/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestString.c b/runtime/core/Clownfish/Test/TestString.c
index 86103e2..64d686c 100644
--- a/runtime/core/Clownfish/Test/TestString.c
+++ b/runtime/core/Clownfish/Test/TestString.c
@@ -52,9 +52,9 @@ static String*
 S_smiley_with_whitespace(int *num_spaces_ptr) {
     int32_t spaces[] = {
         ' ',    '\t',   '\r',   '\n',   0x000B, 0x000C, 0x000D, 0x0085,
-        0x00A0, 0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004,
-        0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028, 0x2029,
-        0x202F, 0x205F, 0x3000
+        0x00A0, 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005,
+        0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028, 0x2029, 0x202F,
+        0x205F, 0x3000
     };
     int num_spaces = sizeof(spaces) / sizeof(uint32_t);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a8ca118b/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 a9c2464..b26dc24 100644
--- a/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ b/runtime/core/Clownfish/Test/Util/TestStringHelper.c
@@ -263,8 +263,6 @@ test_is_whitespace(TestBatchRunner *runner) {
     TEST_TRUE(runner, StrHelp_is_whitespace('\t'), "tab is whitespace");
     TEST_TRUE(runner, StrHelp_is_whitespace('\v'),
               "vertical tab is whitespace");
-    TEST_TRUE(runner, StrHelp_is_whitespace(0x180E),
-              "Mongolian vowel separator is whitespace");
     TEST_FALSE(runner, StrHelp_is_whitespace('a'), "'a' isn't whitespace");
     TEST_FALSE(runner, StrHelp_is_whitespace(0), "NULL isn't whitespace");
     TEST_FALSE(runner, StrHelp_is_whitespace(0x263A),
@@ -287,7 +285,7 @@ test_back_utf8_char(TestBatchRunner *runner) {
 
 void
 TestStrHelp_Run_IMP(TestStringHelper *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 40);
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 39);
     test_overlap(runner);
     test_to_base36(runner);
     test_utf8_round_trip(runner);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a8ca118b/runtime/core/Clownfish/Util/StringHelper.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Util/StringHelper.c b/runtime/core/Clownfish/Util/StringHelper.c
index a2ccdc6..085d8a5 100644
--- a/runtime/core/Clownfish/Util/StringHelper.c
+++ b/runtime/core/Clownfish/Util/StringHelper.c
@@ -135,7 +135,6 @@ StrHelp_is_whitespace(int32_t code_point) {
         case 0x0085: // <control-0085>
         case 0x00A0: // NO-BREAK SPACE
         case 0x1680: // OGHAM SPACE MARK
-        case 0x180E: // MONGOLIAN VOWEL SEPARATOR
             // EN QUAD..HAIR SPACE
         case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004:
         case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009:


[09/14] lucy-clownfish git commit: Remove argument summary from =head2 in hand-rolled POD

Posted by nw...@apache.org.
Remove argument summary from =head2 in hand-rolled POD


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/89157c37
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/89157c37
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/89157c37

Branch: refs/heads/master
Commit: 89157c379e43b4cde6a86737e1dcb2aed96d7d3f
Parents: a8ca118
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Feb 3 14:48:35 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:50:07 2016 +0100

----------------------------------------------------------------------
 .../perl/buildlib/Clownfish/Build/Binding.pm    | 48 ++++++++++++--------
 1 file changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/89157c37/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 8c3619d..bf73807 100644
--- a/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -124,7 +124,7 @@ sub bind_blob {
     my $byte_string = $blob->to_perl;
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(byte_string)
+=head2 new
 
     my $blob = Clownfish::Blob->new($byte_string);
 
@@ -176,11 +176,11 @@ sub bind_boolean {
     }
 END_SYNOPSIS
     my $description = <<'END_DESCRIPTION';
-There are only two singleton instances of this class: `$true_singleton` and
-`$false_singleton` which are exported on demand.
+There are only two singleton instances of this class: C<$true_singleton> and
+C<$false_singleton> which are exported on demand.
 END_DESCRIPTION
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 singleton(truth_value)
+=head2 singleton
 
     my $bool = Clownfish::Boolean->singleton($truth_value);
 
@@ -222,7 +222,7 @@ sub bind_bytebuf {
     my $byte_string = $buf->to_perl;
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(byte_string)
+=head2 new
 
     my $buf = Clownfish::ByteBuf->new($byte_string);
 
@@ -291,7 +291,7 @@ sub bind_string {
     print $string->to_perl, "\n";
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(perl_string)
+=head2 new
 
     my $string = Clownfish::String->new($perl_string);
 
@@ -343,14 +343,18 @@ sub bind_stringiterator {
     }
 END_SYNOPSIS
     my $next_pod = <<'END_POD';
-=head2 next()
+=head2 next
+
+    my $code_point = $iter->next;
 
 Return the code point after the current position and advance the
 iterator. Returns undef at the end of the string. Returns zero
 but true for U+0000.
 END_POD
     my $prev_pod = <<'END_POD';
-=head2 prev()
+=head2 prev
+
+    my $code_point = $iter->prev;
 
 Return the code point before the current position and go one step back.
 Returns undef at the start of the string. Returns zero but true for
@@ -487,7 +491,9 @@ END_SYNOPSIS
     my $hash = Clownfish::Hash->new( capacity => 256 );
 END_CONSTRUCTOR
     my $store_pod = <<'END_POD';
-=head2 store(key, value)
+=head2 store
+
+    $hash->store($key, $value);
 
 Store a key-value pair.
 END_POD
@@ -543,7 +549,7 @@ sub bind_hashiterator {
     }
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(hash)
+=head2 new
 
     my $iter = Clownfish::HashIterator->new($hash);
 
@@ -587,7 +593,7 @@ sub bind_float {
     my $value = $float->get_value;
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(value)
+=head2 new
 
     my $float = Clownfish::Float->new($value);
 
@@ -631,7 +637,7 @@ sub bind_integer {
     my $value = $integer->get_value;
 END_SYNOPSIS
     my $constructor = <<'END_CONSTRUCTOR';
-=head2 new(value)
+=head2 new
 
     my $integer = Clownfish::Integer->new($value);
 
@@ -737,7 +743,9 @@ results in a segfault rather than an exception.)
 
 =head1 CONSTRUCTOR
 
-=head2 new()
+=head2 new
+
+    my $self = $class->SUPER::new;
 
 Abstract constructor -- must be invoked via a subclass.  Attempting to
 instantiate objects of class "Clownfish::Obj" directly causes an
@@ -746,12 +754,14 @@ error.
 Takes no arguments; if any are supplied, an error will be reported.
 END_DESCRIPTION
     my $to_perl_pod = <<'END_POD';
-=head2 to_perl()
+=head2 to_perl
+
+    my $native = $obj->to_perl;
 
 Tries to convert the object to its native Perl representation.
 END_POD
     my $destroy_pod = <<'END_POD';
-=head2 DESTROY()
+=head2 DESTROY
 
 All Clownfish classes implement a DESTROY method; if you override it in a
 subclass, you must call C<< $self->SUPER::DESTROY >> to avoid leaking memory.
@@ -843,9 +853,11 @@ END_SYNOPSIS
     my $vector = Clownfish::Vector->new( capacity => 256 );
 END_CONSTRUCTOR
     my $store_pod = <<'END_POD';
-=head2 store(tick, elem)
+=head2 store
+
+    $vector->store($tick, $elem)
 
-Store an element at index `tick`, possibly displacing an existing element.
+Store an element at index C<tick>, possibly displacing an existing element.
 END_POD
     $pod_spec->set_synopsis($synopsis);
     $pod_spec->add_constructor( alias => 'new', sample => $constructor );
@@ -911,7 +923,7 @@ sub bind_class {
     my $subclass = Clownfish::Class->singleton('Foo::Bar::Jr', $class);
 END_SYNOPSIS
     my $fetch_class_pod = <<'END_CONSTRUCTOR';
-=head2 fetch_class(class_name)
+=head2 fetch_class
 
     my $class = Clownfish::Class->fetch_class($class_name);
 


[07/14] lucy-clownfish git commit: Make HashIterator public

Posted by nw...@apache.org.
Make HashIterator public


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/a7f797c6
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/a7f797c6
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/a7f797c6

Branch: refs/heads/master
Commit: a7f797c657111e9a56722d767ff133637cdf0a34
Parents: 89157c3
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Feb 3 14:52:01 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:50:07 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/HashIterator.cfh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a7f797c6/runtime/core/Clownfish/HashIterator.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/HashIterator.cfh b/runtime/core/Clownfish/HashIterator.cfh
index c346bb2..74ebc44 100644
--- a/runtime/core/Clownfish/HashIterator.cfh
+++ b/runtime/core/Clownfish/HashIterator.cfh
@@ -20,7 +20,9 @@ parcel Clownfish;
  * Hashtable Iterator.
  */
 
-final class Clownfish::HashIterator nickname HashIter inherits Clownfish::Obj {
+public final class Clownfish::HashIterator nickname HashIter
+    inherits Clownfish::Obj {
+
     Hash   *hash;
     size_t  tick;
     size_t  capacity;
@@ -28,10 +30,10 @@ final class Clownfish::HashIterator nickname HashIter inherits Clownfish::Obj {
     inert void
     init_class();
 
-    inert incremented HashIterator*
+    public inert incremented HashIterator*
     new(Hash *hash);
 
-    inert HashIterator*
+    public inert HashIterator*
     init(HashIterator *self, Hash *hash);
 
     public bool


[05/14] lucy-clownfish git commit: Harmonize UTF-8 parameter names

Posted by nw...@apache.org.
Harmonize UTF-8 parameter names


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/814aea8d
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/814aea8d
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/814aea8d

Branch: refs/heads/master
Commit: 814aea8df126be99b2f8b701dc374959e2c02c20
Parents: b8c722b
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jan 11 19:13:17 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:35:36 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/CharBuf.cfh |  4 ++--
 runtime/core/Clownfish/Hash.cfh    |  6 +++---
 runtime/core/Clownfish/String.cfh  | 18 +++++++++---------
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/814aea8d/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index 20af51f..1b61879 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -36,13 +36,13 @@ public final class Clownfish::CharBuf nickname CB
     /** Concatenate the passed-in string onto the end of the CharBuf.
      */
     public void
-    Cat_Utf8(CharBuf *self, const char *ptr, size_t size);
+    Cat_Utf8(CharBuf *self, const char *utf8, size_t size);
 
     /** Concatenate the supplied text onto the end of the CharBuf.  Don't
      * check for UTF-8 validity.
      */
     public void
-    Cat_Trusted_Utf8(CharBuf *self, const char *ptr, size_t size);
+    Cat_Trusted_Utf8(CharBuf *self, const char *utf8, size_t size);
 
     /** Concatenate the contents of `string` onto the end of the
      * caller.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/814aea8d/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Hash.cfh b/runtime/core/Clownfish/Hash.cfh
index c0f9bc2..f653bfe 100644
--- a/runtime/core/Clownfish/Hash.cfh
+++ b/runtime/core/Clownfish/Hash.cfh
@@ -58,7 +58,7 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     Store(Hash *self, String *key, decremented nullable Obj *value);
 
     public void
-    Store_Utf8(Hash *self, const char *str, size_t len,
+    Store_Utf8(Hash *self, const char *utf8, size_t size,
                decremented nullable Obj *value);
 
     /** Fetch the value associated with `key`.
@@ -69,7 +69,7 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     Fetch(Hash *self, String *key);
 
     public nullable Obj*
-    Fetch_Utf8(Hash *self, const char *key, size_t key_len);
+    Fetch_Utf8(Hash *self, const char *utf8, size_t size);
 
     /** Attempt to delete a key-value pair from the hash.
      *
@@ -80,7 +80,7 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     Delete(Hash *self, String *key);
 
     public incremented nullable Obj*
-    Delete_Utf8(Hash *self, const char *key, size_t key_len);
+    Delete_Utf8(Hash *self, const char *utf8, size_t size);
 
     /** Indicate whether the supplied `key` is present.
      */

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/814aea8d/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh
index aa415a2..3d13311 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -122,13 +122,13 @@ public final class Clownfish::String nickname Str
      * character data after checking for validity.
      */
     public incremented String*
-    Cat_Utf8(String *self, const char *ptr, size_t size);
+    Cat_Utf8(String *self, const char *utf8, size_t size);
 
     /** Return the concatenation of the String and the supplied UTF-8
      * character data, skipping validity checks.
      */
     public incremented String*
-    Cat_Trusted_Utf8(String *self, const char *ptr, size_t size);
+    Cat_Trusted_Utf8(String *self, const char *utf8, size_t size);
 
     public int64_t
     To_I64(String *self);
@@ -149,7 +149,7 @@ public final class Clownfish::String nickname Str
     /** Test whether the String starts with `prefix`.
      */
     public bool
-    Starts_With_Utf8(String *self, const char *prefix, size_t size);
+    Starts_With_Utf8(String *self, const char *utf8, size_t size);
 
     /** Test whether the String ends with `suffix`.
      */
@@ -159,7 +159,7 @@ public final class Clownfish::String nickname Str
     /** Test whether the String ends with `suffix`.
      */
     public bool
-    Ends_With_Utf8(String *self, const char *suffix, size_t size);
+    Ends_With_Utf8(String *self, const char *utf8, size_t size);
 
     /** Test whether the String contains `substring`.
      */
@@ -169,7 +169,7 @@ public final class Clownfish::String nickname Str
     /** Test whether the String contains `substring`.
      */
     public bool
-    Contains_Utf8(String *self, const char *ptr, size_t size);
+    Contains_Utf8(String *self, const char *utf8, size_t size);
 
     /** Return a [](StringIterator) pointing to the first occurrence of the
      * substring within the String, or [](@null) if the substring does not
@@ -183,12 +183,12 @@ public final class Clownfish::String nickname Str
      * match.
      */
     public incremented nullable StringIterator*
-    Find_Utf8(String *self, const char *ptr, size_t size);
+    Find_Utf8(String *self, const char *utf8, size_t size);
 
     /** Test whether the String matches the supplied UTF-8 character data.
      */
     public bool
-    Equals_Utf8(String *self, const char *ptr, size_t size);
+    Equals_Utf8(String *self, const char *utf8, size_t size);
 
     /** Return the number of Unicode code points the String contains.
      */
@@ -375,7 +375,7 @@ public final class Clownfish::StringIterator nickname StrIter
     /** Test whether the content after the iterator starts with `prefix`.
      */
     public bool
-    Starts_With_Utf8(StringIterator *self, const char *prefix, size_t size);
+    Starts_With_Utf8(StringIterator *self, const char *utf8, size_t size);
 
     /** Test whether the content before the iterator ends with
      * `suffix`.
@@ -386,7 +386,7 @@ public final class Clownfish::StringIterator nickname StrIter
     /** Test whether the content before the iterator ends with `suffix`.
      */
     public bool
-    Ends_With_Utf8(StringIterator *self, const char *suffix, size_t size);
+    Ends_With_Utf8(StringIterator *self, const char *utf8, size_t size);
 
     public void
     Destroy(StringIterator *self);


[08/14] lucy-clownfish git commit: Improve docucomments

Posted by nw...@apache.org.
Improve docucomments


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/6210eac9
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/6210eac9
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/6210eac9

Branch: refs/heads/master
Commit: 6210eac9aa289b0068139eacd50c0e2301897871
Parents: a7f797c
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Feb 3 15:03:02 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Feb 3 15:50:07 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Blob.cfh         |  37 ++++++++-
 runtime/core/Clownfish/Boolean.cfh      |   2 +
 runtime/core/Clownfish/ByteBuf.cfh      |  54 ++++++++----
 runtime/core/Clownfish/CharBuf.cfh      |  37 +++++++--
 runtime/core/Clownfish/Class.cfh        |  11 ++-
 runtime/core/Clownfish/Err.cfh          |  10 +--
 runtime/core/Clownfish/Hash.cfh         |  35 ++++++--
 runtime/core/Clownfish/HashIterator.cfh |  17 ++++
 runtime/core/Clownfish/Num.cfh          |  55 ++++++++++--
 runtime/core/Clownfish/String.cfh       | 120 ++++++++++++++++++++++-----
 runtime/core/Clownfish/Util/Memory.cfh  |  12 +--
 runtime/core/Clownfish/Vector.cfh       |  31 ++++---
 12 files changed, 346 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Blob.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Blob.cfh b/runtime/core/Clownfish/Blob.cfh
index fce8379..0fa3028 100644
--- a/runtime/core/Clownfish/Blob.cfh
+++ b/runtime/core/Clownfish/Blob.cfh
@@ -26,28 +26,60 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
     size_t      size;
     bool        owns_buf;
 
+    /** Return a new Blob which holds a copy of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert incremented Blob*
     new(const void *bytes, size_t size);
 
+    /** Initialize a Blob which holds a copy of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert Blob*
     init(Blob *self, const void *bytes, size_t size);
 
+    /** Return a new Blob which assumes ownership of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert incremented Blob*
     new_steal(void *bytes, size_t size);
 
+    /** Initialize a Blob which assumes ownership of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert Blob*
     init_steal(Blob *self, void *bytes, size_t size);
 
+    /** Return a new Blob which wraps an external buffer.  The buffer must
+     * stay unchanged for the lifetime of the Blob.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert incremented Blob*
     new_wrap(const void *bytes, size_t size);
 
+    /** Initialize a Blob which wraps an external buffer.  The buffer must
+     * stay unchanged for the lifetime of the Blob.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert Blob*
     init_wrap(Blob *self, const void *bytes, size_t size);
 
     void*
     To_Host(Blob *self);
 
-    /** Accessor for "size" member.
+    /** Return the number of bytes held by the Blob.
      */
     public size_t
     Get_Size(Blob *self);
@@ -58,6 +90,9 @@ public final class Clownfish::Blob inherits Clownfish::Obj {
     Get_Buf(Blob *self);
 
     /** Test whether the Blob matches the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
      */
     public bool
     Equals_Bytes(Blob *self, const void *bytes, size_t size);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Boolean.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Boolean.cfh b/runtime/core/Clownfish/Boolean.cfh
index 29b5f12..6d389db 100644
--- a/runtime/core/Clownfish/Boolean.cfh
+++ b/runtime/core/Clownfish/Boolean.cfh
@@ -44,6 +44,8 @@ public final class Clownfish::Boolean nickname Bool {
     void*
     To_Host(Boolean *self);
 
+    /** Return the value of the Boolean.
+     */
     public bool
     Get_Value(Boolean *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/ByteBuf.cfh b/runtime/core/Clownfish/ByteBuf.cfh
index 8e25d6c..a86bbb2 100644
--- a/runtime/core/Clownfish/ByteBuf.cfh
+++ b/runtime/core/Clownfish/ByteBuf.cfh
@@ -24,33 +24,52 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
 
     char    *buf;
     size_t   size;  /* number of valid bytes */
-    size_t   cap;   /* allocated bytes, including terminating null */
+    size_t   cap;   /* allocated bytes */
 
-    /**
-     * @param capacity initial capacity of the ByteBuf, in bytes.
+    /** Return a new zero-sized ByteBuf.
+     *
+     * @param capacity Initial minimum capacity of the ByteBuf, in bytes.
      */
     public inert incremented ByteBuf*
     new(size_t capacity = 0);
 
+    /** Initialize a ByteBuf.
+     *
+     * @param capacity Initial minimum capacity of the ByteBuf, in bytes.
+     */
     public inert ByteBuf*
     init(ByteBuf *self, size_t capacity = 0);
 
-    /** Return a pointer to a new ByteBuf which holds a copy of the passed-in
-     * bytes.
+    /** Return a new ByteBuf which holds a copy of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
      */
     public inert incremented ByteBuf*
     new_bytes(const void *bytes, size_t size);
 
+    /** Initialize a ByteBuf which holds a copy of the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
+     */
     public inert ByteBuf*
     init_bytes(ByteBuf *self, const void *bytes, size_t size);
 
-    /** Return a pointer to a new ByteBuf which assumes ownership of the
-     * passed-in string.
+    /** Return a new ByteBuf which assumes ownership of the passed-in string.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Initial size of the ByteBuf in bytes.
+     * @param capacity Total allocated bytes in the array.
      */
     public inert incremented ByteBuf*
     new_steal_bytes(void *bytes, size_t size, size_t capacity);
 
-    /** Initialize the ByteBuf and assume ownership of the passed-in string.
+    /** Initialize a ByteBuf and assume ownership of the passed-in string.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Initial size of the ByteBuf in bytes.
+     * @param capacity Total allocated bytes in the array.
      */
     public inert ByteBuf*
     init_steal_bytes(ByteBuf *self, void *bytes, size_t size,
@@ -59,13 +78,13 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     void*
     To_Host(ByteBuf *self);
 
-    /** Set the object's size member.  If greater than the object's capacity,
+    /** Resize the ByteBuf to `size`.  If greater than the object's capacity,
      * throws an error.
      */
     public void
     Set_Size(ByteBuf *self, size_t size);
 
-    /** Accessor for "size" member.
+    /** Return the size of the ByteBuf in bytes.
      */
     public size_t
     Get_Size(ByteBuf *self);
@@ -75,32 +94,36 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     public nullable char*
     Get_Buf(ByteBuf *self);
 
-    /** Return the number of bytes in the Object's allocation.
+    /** Return the number of bytes in the ByteBuf's allocation.
      */
     public size_t
     Get_Capacity(ByteBuf *self);
 
     /** Concatenate the passed-in bytes onto the end of the ByteBuf. Allocate
      * more memory as needed.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
      */
     public void
     Cat_Bytes(ByteBuf *self, const void *bytes, size_t size);
 
-    /** Concatenate the contents of `other` onto the end of the
+    /** Concatenate the contents of [](Blob) `blob` onto the end of the
      * original ByteBuf. Allocate more memory as needed.
      */
     public void
     Cat(ByteBuf *self, Blob *blob);
 
     /** Assign more memory to the ByteBuf, if it doesn't already have enough
-     * room to hold `size` bytes.  Cannot shrink the allocation.
+     * room to hold `capacity` bytes.  Cannot shrink the allocation.
      *
+     * @param capacity The new minimum capacity of the ByteBuf.
      * @return a pointer to the raw buffer.
      */
     public nullable char*
     Grow(ByteBuf *self, size_t capacity);
 
-    /** Return the content of the ByteBuf as Blob and clear the ByteBuf.
+    /** Return the content of the ByteBuf as ()[Blob] and clear the ByteBuf.
      */
     public incremented Blob*
     Yield_Blob(ByteBuf *self);
@@ -118,6 +141,9 @@ public final class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj {
     Trusted_Utf8_To_String(ByteBuf *self);
 
     /** Test whether the ByteBuf matches the passed-in bytes.
+     *
+     * @param bytes Pointer to an array of bytes.
+     * @param size Size of the array in bytes.
      */
     public bool
     Equals_Bytes(ByteBuf *self, const void *bytes, size_t size);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index 1b61879..1270a2d 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -25,27 +25,43 @@ public final class Clownfish::CharBuf nickname CB
 
     char    *ptr;
     size_t   size;
-    size_t   cap;  /* allocated bytes, including terminating null */
+    size_t   cap;  /* allocated bytes */
 
+    /** Return a new CharBuf.
+     *
+     * @param capacity Initial minimum capacity of the CharBuf, in bytes.
+     */
     public inert incremented CharBuf*
     new(size_t capacity = 0);
 
+    /** Initialize a CharBuf.
+     *
+     * @param capacity Initial minimum capacity of the CharBuf, in bytes.
+     */
     public inert CharBuf*
     init(CharBuf *self, size_t capacity = 0);
 
     /** Concatenate the passed-in string onto the end of the CharBuf.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public void
     Cat_Utf8(CharBuf *self, const char *utf8, size_t size);
 
     /** Concatenate the supplied text onto the end of the CharBuf.  Don't
      * check for UTF-8 validity.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public void
     Cat_Trusted_Utf8(CharBuf *self, const char *utf8, size_t size);
 
-    /** Concatenate the contents of `string` onto the end of the
+    /** Concatenate the contents of [](String) `string` onto the end of the
      * caller.
+     *
+     * @param string The String to concatenate.
      */
     public void
     Cat(CharBuf *self, String *string);
@@ -59,19 +75,26 @@ public final class Clownfish::CharBuf nickname CB
      * floats:   %f64
      * hex:      %x32
      *
-     * Note that all Clownfish Objects, including CharBufs, are printed via
+     * Note that all Clownfish Objects, including Strings, are printed via
      * %o (which invokes [](Obj.To_String)).
+     *
+     * @param pattern The format string.
+     * @param args A `va_list` containing the arguments.
      */
     public void
     VCatF(CharBuf *self, const char *pattern, va_list args);
 
-    /** Invokes CB_VCatF to concatenate formatted arguments.  Note that this
+    /** Invokes [](.VCatF) to concatenate formatted arguments.  Note that this
      * is only a function and not a method.
+     *
+     * @param pattern The format string.
      */
     public inert void
     catf(CharBuf *self, const char *pattern, ...);
 
     /** Concatenate one Unicode character onto the end of the CharBuf.
+     *
+     * @param code_point The code point of the Unicode character.
      */
     public void
     Cat_Char(CharBuf *self, int32_t code_point);
@@ -79,6 +102,8 @@ public final class Clownfish::CharBuf nickname CB
     /** Assign more memory to the CharBuf, if it doesn't already have enough
      * room to hold a string of `size` bytes.  Cannot shrink the
      * allocation.
+     *
+     * @param capacity The new minimum capacity of the ByteBuf.
      */
     public void
     Grow(CharBuf *self, size_t capacity);
@@ -88,7 +113,7 @@ public final class Clownfish::CharBuf nickname CB
     public void
     Clear(CharBuf *self);
 
-    /** Get the CharBuf's `size` attribute.
+    /** Return the size of the CharBuf's content in bytes.
      */
     public size_t
     Get_Size(CharBuf *self);
@@ -102,7 +127,7 @@ public final class Clownfish::CharBuf nickname CB
     public incremented String*
     To_String(CharBuf *self);
 
-    /** Return the content of the CharBuf as String and clear the CharBuf.
+    /** Return the content of the CharBuf as [](String) and clear the CharBuf.
      * This is more efficient than [](.To_String).
      */
     public incremented String*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Class.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh
index 7b43e1b..7b5bb59 100644
--- a/runtime/core/Clownfish/Class.cfh
+++ b/runtime/core/Clownfish/Class.cfh
@@ -45,9 +45,9 @@ public final class Clownfish::Class inherits Clownfish::Obj {
 
     /** Return a singleton.  If a Class can be found in the registry based on
      * the supplied class name, it will be returned.  Otherwise, a new Class
-     * will be created using [parent] as a base.
+     * will be created using `parent` as a base.
      *
-     * If [parent] is NULL, an attempt will be made to find it.  If the
+     * If `parent` is [](@null), an attempt will be made to find it.  If the
      * attempt fails, an error will result.
      */
     public inert Class*
@@ -118,12 +118,19 @@ public final class Clownfish::Class inherits Clownfish::Obj {
     void
     Exclude_Host_Method(Class *self, const char *meth_name);
 
+    /** Return the name of the class.
+     */
     public String*
     Get_Name(Class *self);
 
+    /** Return the parent class, or [](@null) for a root of the class
+     * hierarchy.
+     */
     public nullable Class*
     Get_Parent(Class *self);
 
+    /** Return the number of bytes needed to hold an object the class.
+     */
     public uint32_t
     Get_Obj_Alloc_Size(Class *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Err.cfh b/runtime/core/Clownfish/Err.cfh
index d863119..e6dce87 100644
--- a/runtime/core/Clownfish/Err.cfh
+++ b/runtime/core/Clownfish/Err.cfh
@@ -55,7 +55,7 @@ public class Clownfish::Err inherits Clownfish::Obj {
     public incremented String*
     To_String(Err *self);
 
-    /** Concatenate the supplied argument onto the internal "mess".
+    /** Concatenate the supplied argument onto the error message.
      */
     public void
     Cat_Mess(Err *self, String *mess);
@@ -63,17 +63,17 @@ public class Clownfish::Err inherits Clownfish::Obj {
     public String*
     Get_Mess(Err *self);
 
-    /** Add information about the current stack frame onto `mess`.
+    /** Add information about the current stack frame onto the error message.
      */
     void
     Add_Frame(Err *self, const char *file, int line, const char *func);
 
-    /** Set the value of "error", a per-thread Err shared variable.
+    /** Set the global error object, a per-thread Err shared variable.
      */
     public inert void
     set_error(decremented Err *error);
 
-    /** Retrieve per-thread Err shared variable "error".
+    /** Retrieve the global error object, a per-thread Err shared variable.
      */
     public inert nullable Err*
     get_error();
@@ -100,7 +100,7 @@ public class Clownfish::Err inherits Clownfish::Obj {
      */
     inert void
     throw_at(Class *klass, const char *file, int line, const char *func,
-               const char *pattern, ...);
+             const char *pattern, ...);
 
     /** Throw an existing exception after tacking on additional context data.
      */

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Hash.cfh b/runtime/core/Clownfish/Hash.cfh
index f653bfe..b2fa243 100644
--- a/runtime/core/Clownfish/Hash.cfh
+++ b/runtime/core/Clownfish/Hash.cfh
@@ -31,10 +31,16 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     inert void
     init_class();
 
+    /** Return a new Hash.
+     *
+     * @param capacity The number of elements that the hash will be asked to
+     * hold initially.
+     */
     public inert incremented Hash*
     new(size_t capacity = 0);
 
-    /**
+    /** Initialize a Hash.
+     *
      * @param capacity The number of elements that the hash will be asked to
      * hold initially.
      */
@@ -57,6 +63,12 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     public void
     Store(Hash *self, String *key, decremented nullable Obj *value);
 
+    /** Store a key-value pair using a raw UTF-8 key.
+     *
+     * @param utf8 Pointer to UTF-8 character data of the key.
+     * @param size Size of UTF-8 character data in bytes.
+     * @param The Obj to store.
+     */
     public void
     Store_Utf8(Hash *self, const char *utf8, size_t size,
                decremented nullable Obj *value);
@@ -68,6 +80,12 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     public nullable Obj*
     Fetch(Hash *self, String *key);
 
+    /** Fetch the value associated with a raw UTF-8 key.
+     *
+     * @param utf8 Pointer to UTF-8 character data of the key.
+     * @param size Size of UTF-8 character data in bytes.
+     * @return the value, or NULL if `key` is not present.
+     */
     public nullable Obj*
     Fetch_Utf8(Hash *self, const char *utf8, size_t size);
 
@@ -79,6 +97,13 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     public incremented nullable Obj*
     Delete(Hash *self, String *key);
 
+    /** Attempt to delete a key-value pair from the hash.
+     *
+     * @param utf8 Pointer to UTF-8 character data of the key.
+     * @param size Size of UTF-8 character data in bytes.
+     * @return the value if `key` exists and thus deletion
+     * succeeds; otherwise NULL.
+     */
     public incremented nullable Obj*
     Delete_Utf8(Hash *self, const char *utf8, size_t size);
 
@@ -87,12 +112,12 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     public bool
     Has_Key(Hash *self, String *key);
 
-    /** Return an Vector of pointers to the hash's keys.
+    /** Return a Vector of pointers to the hash's keys.
      */
     public incremented Vector*
     Keys(Hash *self);
 
-    /** Return an Vector of pointers to the hash's values.
+    /** Return a Vector of pointers to the hash's values.
      */
     public incremented Vector*
     Values(Hash *self);
@@ -100,9 +125,7 @@ public final class Clownfish::Hash inherits Clownfish::Obj {
     size_t
     Get_Capacity(Hash *self);
 
-    /** Accessor for Hash's "size" member.
-     *
-     * @return the number of key-value pairs.
+    /** Return the number of key-value pairs.
      */
     public size_t
     Get_Size(Hash *self);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/HashIterator.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/HashIterator.cfh b/runtime/core/Clownfish/HashIterator.cfh
index 74ebc44..0815d3a 100644
--- a/runtime/core/Clownfish/HashIterator.cfh
+++ b/runtime/core/Clownfish/HashIterator.cfh
@@ -30,18 +30,35 @@ public final class Clownfish::HashIterator nickname HashIter
     inert void
     init_class();
 
+    /** Return a HashIterator for `hash`.
+     */
     public inert incremented HashIterator*
     new(Hash *hash);
 
+    /** Initialize a HashIterator for `hash`.
+     */
     public inert HashIterator*
     init(HashIterator *self, Hash *hash);
 
+    /** Advance the iterator to the next key-value pair.
+     *
+     * @return true if there's another key-value pair, false if the iterator
+     * is exhausted.
+     */
     public bool
     Next(HashIterator *self);
 
+    /** Return the key of the current key-value pair.  It's not allowed to
+     * call this method before [](.Next) was called for the first time or
+     * after the iterator was exhausted.
+     */
     public String*
     Get_Key(HashIterator *self);
 
+    /** Return the value of the current key-value pair.  It's not allowed to
+     * call this method before [](.Next) was called for the first time or
+     * after the iterator was exhausted.
+     */
     public nullable Obj*
     Get_Value(HashIterator *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Num.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Num.cfh b/runtime/core/Clownfish/Num.cfh
index dad03a5..0f74f9d 100644
--- a/runtime/core/Clownfish/Num.cfh
+++ b/runtime/core/Clownfish/Num.cfh
@@ -22,30 +22,52 @@ public final class Clownfish::Float {
 
     double value;
 
-    /**
+    /** Return a new Float.
+     *
      * @param value Initial value.
      */
     public inert Float*
-    init(Float* self, double value);
+    new(double value);
 
+    /** Initialize a Float.
+     *
+     * @param value Initial value.
+     */
     public inert Float*
-    new(double value);
+    init(Float* self, double value);
 
     void*
     To_Host(Float *self);
 
+    /** Return the value of the Float.
+     */
     public double
     Get_Value(Float *self);
 
+    /** Convert the Float to an integer, truncating toward zero.  Throw an
+     * exception if the value is out of the range of an `int64_t`.
+     */
     public int64_t
     To_I64(Float *self);
 
     public incremented String*
     To_String(Float *self);
 
+    /** Indicate whether two numbers are the same.
+     *
+     * @param other A Float or an Integer.
+     */
     public bool
     Equals(Float *self, Obj *other);
 
+    /** Indicate whether one number is less than, equal to, or greater than
+     * another.
+     *
+     * @param other A Float or an Integer.
+     * @return 0 if the numbers are equal, a negative number if `self` is
+     * less than `other`, and a positive number if `self` is greater than
+     * `other`.
+     */
     public int32_t
     Compare_To(Float *self, Obj *other);
 
@@ -60,30 +82,51 @@ public final class Clownfish::Integer nickname Int {
 
     int64_t value;
 
-    /**
+    /** Return a new Integer.
+     *
      * @param value Initial value.
      */
     public inert Integer*
-    init(Integer* self, int64_t value);
+    new(int64_t value);
 
+    /** Initialize an Integer.
+     *
+     * @param value Initial value.
+     */
     public inert Integer*
-    new(int64_t value);
+    init(Integer* self, int64_t value);
 
     void*
     To_Host(Integer *self);
 
+    /** Return the value of the Integer.
+     */
     public int64_t
     Get_Value(Integer *self);
 
+    /** Convert the Integer to floating point.
+     */
     public double
     To_F64(Integer *self);
 
     public incremented String*
     To_String(Integer *self);
 
+    /** Indicate whether two numbers are the same.
+     *
+     * @param other An Integer or a Float.
+     */
     public bool
     Equals(Integer *self, Obj *other);
 
+    /** Indicate whether one number is less than, equal to, or greater than
+     * another.
+     *
+     * @param other An Integer or a Float.
+     * @return 0 if the numbers are equal, a negative number if `self` is
+     * less than `other`, and a positive number if `self` is greater than
+     * `other`.
+     */
     public int32_t
     Compare_To(Integer *self, Obj *other);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh
index 3d13311..3d7ba5d 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -39,36 +39,54 @@ public final class Clownfish::String nickname Str
 
     /** Return a String which holds a copy of the supplied UTF-8 character
      * data after checking for validity.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_from_utf8(const char *utf8, size_t size);
 
     /** Return a String which holds a copy of the supplied UTF-8 character
      * data, skipping validity checks.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_from_trusted_utf8(const char *utf8, size_t size);
 
     /** Initialize a String which holds a copy of the supplied UTF-8 character
      * data, skipping validity checks.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert String*
     init_from_trusted_utf8(String *self, const char *utf8, size_t size);
 
     /** Return a String which assumes ownership of the supplied buffer
      * containing UTF-8 character data after checking for validity.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_steal_utf8(char *utf8, size_t size);
 
     /** Return a String which assumes ownership of the supplied buffer
      * containing UTF-8 character data, skipping validity checks.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_steal_trusted_utf8(char *utf8, size_t size);
 
     /** Initialize a String which assumes ownership of the supplied buffer
      * containing UTF-8 character data, skipping validity checks.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert String*
     init_steal_trusted_utf8(String *self, char *utf8, size_t size);
@@ -76,6 +94,9 @@ public final class Clownfish::String nickname Str
     /** Return a String which wraps an external buffer containing UTF-8
      * character data after checking for validity.  The buffer must stay
      * unchanged for the lifetime of the String.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_wrap_utf8(const char *utf8, size_t size);
@@ -83,6 +104,9 @@ public final class Clownfish::String nickname Str
     /** Return a String which wraps an external buffer containing UTF-8
      * character data, skipping validity checks.  The buffer must stay
      * unchanged for the lifetime of the String.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert incremented String*
     new_wrap_trusted_utf8(const char *utf8, size_t size);
@@ -92,20 +116,27 @@ public final class Clownfish::String nickname Str
 
     /** Initialize a String which wraps an external buffer containing UTF-8
      * character data after checking for validity.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public inert String*
     init_wrap_trusted_utf8(String *self, const char *utf8, size_t size);
 
     /** Return a String which holds a single character.
+     *
+     * @param code_point Unicode code point of the character.
      */
     public inert incremented String*
     new_from_char(int32_t code_point);
 
     /** Return a String with content expanded from a pattern and arguments
-     * conforming to the spec defined by CharBuf.
+     * conforming to the spec defined by [](CharBuf.VCatF).
      *
      * Note: a user-supplied `pattern` string is a security hole
      * and must not be allowed.
+     *
+     * @param pattern A format string.
      */
     public inert incremented String*
     newf(const char *pattern, ...);
@@ -120,24 +151,41 @@ public final class Clownfish::String nickname Str
 
     /** Return the concatenation of the String and the supplied UTF-8
      * character data after checking for validity.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public incremented String*
     Cat_Utf8(String *self, const char *utf8, size_t size);
 
     /** Return the concatenation of the String and the supplied UTF-8
      * character data, skipping validity checks.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public incremented String*
     Cat_Trusted_Utf8(String *self, const char *utf8, size_t size);
 
+    /** Extract a 64-bit integer from a decimal string.  See [](.BaseX_To_I64)
+     * for details.
+     */
     public int64_t
     To_I64(String *self);
 
     /** Extract a 64-bit integer from a variable-base stringified version.
+     * Expects an optional minus sign followed by base-x digits, stopping at
+     * any non-digit character.  Returns zero if no digits are found.  If the
+     * value exceeds the range of an `int64_t`, the result is undefined.
+     *
+     * @param base A base between 2 and 36.
      */
     public int64_t
     BaseX_To_I64(String *self, uint32_t base);
 
+    /** Convert a string to a floating-point number using the C library
+     * function `strtod`.
+     */
     public double
     To_F64(String *self);
 
@@ -146,7 +194,10 @@ public final class Clownfish::String nickname Str
     public bool
     Starts_With(String *self, String *prefix);
 
-    /** Test whether the String starts with `prefix`.
+    /** Test whether the String starts with a prefix supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public bool
     Starts_With_Utf8(String *self, const char *utf8, size_t size);
@@ -156,7 +207,10 @@ public final class Clownfish::String nickname Str
     public bool
     Ends_With(String *self, String *suffix);
 
-    /** Test whether the String ends with `suffix`.
+    /** Test whether the String ends with a suffix supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public bool
     Ends_With_Utf8(String *self, const char *utf8, size_t size);
@@ -166,13 +220,16 @@ public final class Clownfish::String nickname Str
     public bool
     Contains(String *self, String *substring);
 
-    /** Test whether the String contains `substring`.
+    /** Test whether the String contains a substring supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public bool
     Contains_Utf8(String *self, const char *utf8, size_t size);
 
-    /** Return a [](StringIterator) pointing to the first occurrence of the
-     * substring within the String, or [](@null) if the substring does not
+    /** Return a [](StringIterator) pointing to the first occurrence of
+     * `substring` within the String, or [](@null) if the substring does not
      * match.
      */
     public incremented nullable StringIterator*
@@ -180,7 +237,10 @@ public final class Clownfish::String nickname Str
 
     /** Return a [](StringIterator) pointing to the first occurrence of the
      * substring within the String, or [](@null) if the substring does not
-     * match.
+     * match.  The substring is supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public incremented nullable StringIterator*
     Find_Utf8(String *self, const char *utf8, size_t size);
@@ -202,6 +262,7 @@ public final class Clownfish::String nickname Str
 
     /** Return the internal backing array for the String if its internal
      * encoding is UTF-8.  If it is not encoded as UTF-8 throw an exception.
+     * The character data is not null-terminated.
      */
     public const char*
     Get_Ptr8(String *self);
@@ -241,33 +302,38 @@ public final class Clownfish::String nickname Str
     To_String(String *self);
 
     /** Remove Unicode whitespace characters from both top and tail.
+     * Whitespace is any character that has the Unicode property
+     * `White_Space`.
      */
     public incremented String*
     Trim(String *self);
 
-    /** Remove leading Unicode whitespace.
+    /** Remove leading Unicode whitespace.  Whitespace is any character
+     * that has the Unicode property `White_Space`.
      */
     public incremented String*
     Trim_Top(String *self);
 
-    /** Remove trailing Unicode whitespace.
+    /** Remove trailing Unicode whitespace.  Whitespace is any character
+     * that has the Unicode property `White_Space`.
      */
     public incremented String*
     Trim_Tail(String *self);
 
     /** Return the Unicode code point located `tick` code points in from the
-     * top.  Return CFISH_STR_OOB if out of bounds.
+     * top.  Return `CFISH_STR_OOB` if out of bounds.
      */
     public int32_t
     Code_Point_At(String *self, size_t tick);
 
     /** Return the Unicode code point located `tick` code points counting
-     * backwards from the end.  Return CFISH_STR_OOB if out of bounds.
+     * backwards from the end.  Return `CFISH_STR_OOB` if out of bounds.
      */
     public int32_t
     Code_Point_From(String *self, size_t tick);
 
     /** Return a new String containing a copy of the specified substring.
+     *
      * @param offset Offset from the top, in code points.
      * @param len The desired length of the substring, in code points.
      */
@@ -299,6 +365,7 @@ public final class Clownfish::StringIterator nickname StrIter
     new(String *string, size_t byte_offset);
 
     /** Return the substring between the top and tail iterators.
+     *
      * @param top Top iterator. Use start of string if [](@null).
      * @param tail Tail iterator. Use end of string if [](@null).
      */
@@ -308,6 +375,8 @@ public final class Clownfish::StringIterator nickname StrIter
     public incremented StringIterator*
     Clone(StringIterator *self);
 
+    /** Assign the source string and current position of `other` to `self`.
+     */
     public void
     Assign(StringIterator *self, StringIterator *other);
 
@@ -328,18 +397,19 @@ public final class Clownfish::StringIterator nickname StrIter
     Has_Prev(StringIterator *self);
 
     /** Return the code point after the current position and advance the
-     * iterator. Return CFISH_STR_OOB at the end of the string.
+     * iterator. Return `CFISH_STR_OOB` at the end of the string.
      */
     public int32_t
     Next(StringIterator *self);
 
     /** Return the code point before the current position and go one step back.
-     * Return CFISH_STR_OOB at the start of the string.
+     * Return `CFISH_STR_OOB` at the start of the string.
      */
     public int32_t
     Prev(StringIterator *self);
 
     /** Skip code points.
+     *
      * @param num The number of code points to skip.
      * @return the number of code points actually skipped. This can be less
      * than the requested number if the end of the string is reached.
@@ -348,6 +418,7 @@ public final class Clownfish::StringIterator nickname StrIter
     Advance(StringIterator *self, size_t num);
 
     /** Skip code points backward.
+     *
      * @param num The number of code points to skip.
      * @return the number of code points actually skipped. This can be less
      * than the requested number if the start of the string is reached.
@@ -355,13 +426,17 @@ public final class Clownfish::StringIterator nickname StrIter
     public size_t
     Recede(StringIterator *self, size_t num);
 
-    /** Skip whitespace.
+    /** Skip whitespace.  Whitespace is any character that has the Unicode
+     * property `White_Space`.
+     *
      * @return the number of code points skipped.
      */
     public size_t
     Skip_Whitespace(StringIterator *self);
 
-    /** Skip whitespace backward.
+    /** Skip whitespace backward.  Whitespace is any character that has the
+     * Unicode property `White_Space`.
+     *
      * @return the number of code points skipped.
      */
     public size_t
@@ -372,18 +447,25 @@ public final class Clownfish::StringIterator nickname StrIter
     public bool
     Starts_With(StringIterator *self, String *prefix);
 
-    /** Test whether the content after the iterator starts with `prefix`.
+    /** Test whether the content after the iterator starts with a prefix
+     * supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public bool
     Starts_With_Utf8(StringIterator *self, const char *utf8, size_t size);
 
-    /** Test whether the content before the iterator ends with
-     * `suffix`.
+    /** Test whether the content before the iterator ends with `suffix`.
      */
     public bool
     Ends_With(StringIterator *self, String *suffix);
 
-    /** Test whether the content before the iterator ends with `suffix`.
+    /** Test whether the content before the iterator ends with a suffix
+     * supplied as raw UTF-8.
+     *
+     * @param utf8 Pointer to UTF-8 character data.
+     * @param size Size of UTF-8 character data in bytes.
      */
     public bool
     Ends_With_Utf8(StringIterator *self, const char *utf8, size_t size);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Util/Memory.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Util/Memory.cfh b/runtime/core/Clownfish/Util/Memory.cfh
index 69ae85f..d94cf9e 100644
--- a/runtime/core/Clownfish/Util/Memory.cfh
+++ b/runtime/core/Clownfish/Util/Memory.cfh
@@ -18,20 +18,20 @@ parcel Clownfish;
 
 inert class Clownfish::Util::Memory {
 
-    /** Attempt to allocate memory with malloc, but print an error and exit if the
-     * call fails.
+    /** Attempt to allocate memory with malloc, but print an error and exit
+     * if the call fails.
      */
     inert nullable void*
     wrapped_malloc(size_t count);
 
-    /** Attempt to allocate memory with calloc, but print an error and exit if the
-     * call fails.
+    /** Attempt to allocate memory with calloc, but print an error and exit
+     * if the call fails.
      */
     inert nullable void*
     wrapped_calloc(size_t count, size_t size);
 
-    /** Attempt to allocate memory with realloc, but print an error and exit if
-     * the call fails.
+    /** Attempt to allocate memory with realloc, but print an error and exit
+     * if the call fails.
      */
     inert nullable void*
     wrapped_realloc(void *ptr, size_t size);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6210eac9/runtime/core/Clownfish/Vector.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Vector.cfh b/runtime/core/Clownfish/Vector.cfh
index 9271988..3f902f9 100644
--- a/runtime/core/Clownfish/Vector.cfh
+++ b/runtime/core/Clownfish/Vector.cfh
@@ -24,10 +24,16 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     size_t     size;
     size_t     cap;
 
+    /** Return a new Vector.
+     *
+     * @param capacity Initial number of elements that the object will be able
+     * to hold before reallocation.
+     */
     public inert incremented Vector*
     new(size_t capacity = 0);
 
-    /**
+    /** Initialize a Vector.
+     *
      * @param capacity Initial number of elements that the object will be able
      * to hold before reallocation.
      */
@@ -48,6 +54,8 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     Push_All(Vector *self, Vector *other);
 
     /** Pop an item off of the end of a Vector.
+     *
+     * @return the element or [](@null) if the Vector is empty.
      */
     public incremented nullable Obj*
     Pop(Vector *self);
@@ -63,13 +71,14 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     public void
     Insert_All(Vector *self, size_t tick, Vector *other);
 
-    /** Ensure that the Vector has room for at least `capacity`
-     * elements.
+    /** Ensure that the Vector has room for at least `capacity` elements.
      */
     void
     Grow(Vector *self, size_t capacity);
 
     /** Fetch the element at `tick`.
+     *
+     * @return the element or [](@null) if `tick` is out of bounds.
      */
     public nullable Obj*
     Fetch(Vector *self, size_t tick);
@@ -82,13 +91,14 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
 
     /** Replace an element in the Vector with NULL and return it.
      *
-     * @return whatever was stored at `tick`.
+     * @return the element stored at `tick` or [](@null) if `tick` is out of
+     * bounds.
      */
     public incremented nullable Obj*
     Delete(Vector *self, size_t tick);
 
-    /** Remove `length` elements from the vector, starting at
-     * `offset`. Move elements over to fill in the gap.
+    /** Remove `length` elements from the vector, starting at `offset`.
+     * Move elements over to fill in the gap.
      */
     public void
     Excise(Vector *self, size_t offset, size_t length);
@@ -106,8 +116,8 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     Sort(Vector *self);
 
     /** Set the size for the Vector.  If the new size is larger than the
-     * current size, grow the object to accommodate NULL elements; if smaller
-     * than the current size, decrement and discard truncated elements.
+     * current size, grow the object to accommodate [](@null) elements; if
+     * smaller than the current size, decrement and discard truncated elements.
      */
     public void
     Resize(Vector *self, size_t size);
@@ -117,12 +127,13 @@ public final class Clownfish::Vector nickname Vec inherits Clownfish::Obj {
     public void
     Clear(Vector *self);
 
-    /** Accessor for `size` member.
+    /** Return the size of the Vector.
      */
     public size_t
     Get_Size(Vector *self);
 
-    /** Accessor for `capacity` member.
+    /** Return the capacity of the Vector.  This is the maximum number of
+     * elements the Vector can hold without reallocation.
      */
     size_t
     Get_Capacity(Vector *self);


[12/14] lucy-clownfish git commit: Document To_String in each class

Posted by nw...@apache.org.
Document To_String in each class


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/a452c422
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/a452c422
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/a452c422

Branch: refs/heads/master
Commit: a452c422fb9a9e9fc0434ce38aa84af6c6881097
Parents: 08ccc75
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Feb 4 14:14:41 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Feb 4 14:34:45 2016 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Boolean.cfh | 2 ++
 runtime/core/Clownfish/CharBuf.cfh | 2 ++
 runtime/core/Clownfish/Err.cfh     | 2 ++
 runtime/core/Clownfish/Num.cfh     | 5 +++++
 runtime/core/Clownfish/String.cfh  | 2 ++
 5 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a452c422/runtime/core/Clownfish/Boolean.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Boolean.cfh b/runtime/core/Clownfish/Boolean.cfh
index 453b414..17d637e 100644
--- a/runtime/core/Clownfish/Boolean.cfh
+++ b/runtime/core/Clownfish/Boolean.cfh
@@ -60,6 +60,8 @@ public final class Clownfish::Boolean nickname Bool {
     public bool
     Equals(Boolean *self, Obj *other);
 
+    /** Return "true" for true values and "false" for false values.
+     */
     public incremented String*
     To_String(Boolean *self);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a452c422/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/CharBuf.cfh b/runtime/core/Clownfish/CharBuf.cfh
index 07faab7..e4ab770 100644
--- a/runtime/core/Clownfish/CharBuf.cfh
+++ b/runtime/core/Clownfish/CharBuf.cfh
@@ -124,6 +124,8 @@ public final class Clownfish::CharBuf nickname CB
     public void
     Destroy(CharBuf *self);
 
+    /** Return the content of the CharBuf as String.
+     */
     public incremented String*
     To_String(CharBuf *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a452c422/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Err.cfh b/runtime/core/Clownfish/Err.cfh
index c05abb2..8136caa 100644
--- a/runtime/core/Clownfish/Err.cfh
+++ b/runtime/core/Clownfish/Err.cfh
@@ -52,6 +52,8 @@ public class Clownfish::Err inherits Clownfish::Obj {
     public void
     Destroy(Err *self);
 
+    /** Return a copy of the error message.
+     */
     public incremented String*
     To_String(Err *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a452c422/runtime/core/Clownfish/Num.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Num.cfh b/runtime/core/Clownfish/Num.cfh
index d32787c..07befa4 100644
--- a/runtime/core/Clownfish/Num.cfh
+++ b/runtime/core/Clownfish/Num.cfh
@@ -50,6 +50,9 @@ public final class Clownfish::Float {
     public int64_t
     To_I64(Float *self);
 
+    /** Return the Float formatted as String using `sprintf` with conversion
+     * specifier `%g`.
+     */
     public incremented String*
     To_String(Float *self);
 
@@ -110,6 +113,8 @@ public final class Clownfish::Integer nickname Int {
     public double
     To_F64(Integer *self);
 
+    /** Return the Integer formatted as String.
+     */
     public incremented String*
     To_String(Integer *self);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a452c422/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh
index 6272a1a..6479930 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -310,6 +310,8 @@ public final class Clownfish::String nickname Str
     size_t
     Hash_Sum(String *self);
 
+    /** Return a copy of the String.
+     */
     public incremented String*
     To_String(String *self);