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/23 14:31:28 UTC
[5/6] lucy-clownfish git commit: Documentation fixes
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/32e2701a
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/32e2701a
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/32e2701a
Branch: refs/heads/master
Commit: 32e2701aa37eaf3f680dd53a59ac274d246a1cbc
Parents: 82f8cf5
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Feb 23 13:20:08 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Feb 23 13:25:53 2016 +0100
----------------------------------------------------------------------
runtime/core/Clownfish.md | 2 +-
runtime/core/Clownfish/Docs/ClassIntro.md | 4 ++--
runtime/core/Clownfish/Docs/WritingClasses.md | 20 ++++++++++----------
3 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/32e2701a/runtime/core/Clownfish.md
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish.md b/runtime/core/Clownfish.md
index 8caa761..d2a02a1 100644
--- a/runtime/core/Clownfish.md
+++ b/runtime/core/Clownfish.md
@@ -33,7 +33,7 @@ language bindings, initialization code and documentation from a set of
Clownfish header files. The generated code is compiled with other project
code and linked with the Clownfish runtime.
-Clownfish header files have a `.cfh` extensions and define classes used within
+Clownfish header files have a `.cfh` extension and define classes used within
the Clownfish object system. The object system is implemented in C and
supports single inheritance and virtual method dispatch. CFC creates a C
header file from each Clownfish header containing the C interface to Clownfish
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/32e2701a/runtime/core/Clownfish/Docs/ClassIntro.md
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Docs/ClassIntro.md b/runtime/core/Clownfish/Docs/ClassIntro.md
index e23fdba..339f08c 100644
--- a/runtime/core/Clownfish/Docs/ClassIntro.md
+++ b/runtime/core/Clownfish/Docs/ClassIntro.md
@@ -39,7 +39,7 @@ For example the String class has the nickname `Str`.
## Creating objects
-A Clownfish object is a pointer to an opaque struct.
+A Clownfish object is an opaque struct referenced by pointer.
Most classes come with one or more constructors. On the C level, a
constructor is simply an "inert" function of a class that returns a
@@ -54,7 +54,7 @@ Example:
## Calling methods
-Calling methods is straight-forward. The invocant is always passed as
+Calling methods is straightforward. The invocant is always passed as
first argument.
// Notice the use of nickname "Str" in the method prefix.
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/32e2701a/runtime/core/Clownfish/Docs/WritingClasses.md
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Docs/WritingClasses.md b/runtime/core/Clownfish/Docs/WritingClasses.md
index 806c06f..5e79788 100644
--- a/runtime/core/Clownfish/Docs/WritingClasses.md
+++ b/runtime/core/Clownfish/Docs/WritingClasses.md
@@ -10,13 +10,13 @@ files which contain a JSON hash with the following keys:
* __nickname:__ A short nickname. It must contain only letters. This nickname,
followed by an underscore, is used to prefix generated C symbols and
- macros. Depending on the kind of symbol, a lowercase, mixed case, or
- uppercase prefix will be used.
+ macros. Depending on the kind of symbol, a lowercase or uppercase prefix
+ will be used.
* __version:__ A version specifier of the following form (without whitespace):
version-specifier = "v" version-number
- version-number = digit | digit "." version-number
+ version-number = digit+ | digit+ "." version-number
* __prerequisites:__ A hash containing the prerequisite parcels. The hash keys
are the parcel names. The values contain the minimum required version.
@@ -180,7 +180,7 @@ definition will look like:
### Instance variables
Non-inert variables are instance variables and added to the class's ivars
-struct. They must not have an exposure specifier.
+struct.
Example:
@@ -338,7 +338,7 @@ implementation will look like:
/* Implementation */
}
-### Looking up function pointers
+### Looking up methods
Clownfish defines a macro named `CFISH_METHOD_PTR` that looks up the pointer
to the implementing function of a method. The first parameter of the macro is
@@ -351,11 +351,12 @@ with the same parameters.
Example using short names:
+ // Note that the name of the method wrapper must not be shortened.
VisGraph_Add_Node_t add_node
- = METHOD_PTR(PFIND_VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
+ = METHOD_PTR(VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
VisGraph_Add_Node_t super_add_node
- = SUPER_METHOD_PTR(PFIND_VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
+ = SUPER_METHOD_PTR(VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
### Abstract methods
@@ -438,9 +439,8 @@ pointer to an object as first argument and return a pointer to the same
object. If the parent class has an initializer, it should be called first by
the subclass's initializer.
-By convention, the standard constructor is named `new`. If a class has an
-inert function named `init`, it is used as initializer to create a host
-language constructor by default.
+By convention, the standard constructor is named `new` and the standard
+initializer `init`.
Example: