Skip to content

Commit

Permalink
Merge pull request #5 from zipperer/patch-1
Browse files Browse the repository at this point in the history
examples: propose edits to what I take as typos
  • Loading branch information
blakemcbride authored Mar 13, 2024
2 parents fdb9c4a + 6d1ae50 commit 79d7873
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/exam01/readme
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ files) use the following:



Note that the file ..\list contains the most up-to-date list of example
Note that the file ..\list.txt contains the most up-to-date list of example
programs.

After this example, you will want to continue in numeric order with
Expand Down
2 changes: 1 addition & 1 deletion examples/exam03/readme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


This example demonstrates the creation, use and disposal of aditional
This example demonstrates the creation, use and disposal of additional
simple objects.

Notice how the same local variable can be used to represent arbitrary
Expand Down
4 changes: 2 additions & 2 deletions examples/exam06/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main(int argc, char *argv[])
Note that although the dictionary is set up to hold roughly 49
elements, it may actually hold any number, it's just that
the effeciency of the dictionary will start to go down at
arount 49 elements. */
around 49 elements. */

strDict = gNewWithInt(StringDictionary, 49);

Expand Down Expand Up @@ -53,7 +53,7 @@ int main(int argc, char *argv[])


/* Dispose of the entire link object and all objects held */
/* (again only necessary of garbage collector not used) */
/* (again only necessary if garbage collector not used) */

gDeepDispose(strDict);

Expand Down
2 changes: 1 addition & 1 deletion examples/exam07/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main(int argc, char *argv[])
InitDynace(&argc);


/* Create, initialize and print an instance of StringDictionary */
/* Create, initialize and print an instance of StringDictionary */

strDict = gNewWithInt(StringDictionary, 49);
gAddStr(strDict, "Key 1", gNewWithStr(String, "The first value added."));
Expand Down
6 changes: 3 additions & 3 deletions examples/exam10/readme
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Note that any number of files may use or sub-class from any
given class.

The Dynace Pre-Processor (dpp) is used to read in class files (which end
in .d), generate generics files (generics.c & .h), and create .c souce
in .d), generate generics files (generics.c & .h), and create .c source
files corresponding to the .d class files. The .c files which are
generated from the .d files are compiled by your normal C compiler to
generate linkable object files. This program also ensures the argument
consistancy between methods and generics. If a discrepancy is detected,
consistency between methods and generics. If a discrepancy is detected,
a message is displayed and the build process terminates.

The elaborate makefile is used to insure the correct and minimum number
The elaborate makefile is used to ensure the correct and minimum number
of files get processed whenever a file is changed. It should, however,
be easy to modify by changing the variables at the beginning of the
makefile.
Expand Down
2 changes: 1 addition & 1 deletion examples/exam11/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main(int argc, char *argv[])
myObj = gNew(Class1);

/* If the garbage collector is not being used you must dispose of
an object which is no longer needed (unless of course you program
an object which is no longer needed (unless of course your program
is terminating, in which case all the objects will be freed
anyway.) This method is also being inherited from the Object
class. */
Expand Down
8 changes: 4 additions & 4 deletions examples/exam12/class1.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defclass Class1 {
convention is to use a leading 'g' followed by an uppercase letter to
designate a generic (instance or class) which is using compile-time
argument checking. A leading 'v' followed by an uppercase letter is
used to indicate a variable argument generic, or one whos arguments are
used to indicate a variable argument generic, or one whose arguments are
not checked at compile time. The 'g' stands for generic, and the 'v'
stands for variable argument generic.
Expand All @@ -48,9 +48,9 @@ defclass Class1 {
This specific generic (gSetName) takes an additional argument 'char *name'.
Notice how the instance variables associated with the instance passed to
the method (as the first argument) are immediatly accessable. This is
the method (as the first argument) are immediately accessible. This is
one reason for the instance variable naming convention. Otherwise,
it may be difficult to distinguish betweem instance variables and local
it may be difficult to distinguish between instance variables and local
variables.
This method simply copies the argument passed to the specified instance
Expand All @@ -71,7 +71,7 @@ imeth gSetName(char *name)
This new method, named get_name, is explictly defined to return a char *.
Also, the method is explicitly associated with the gGetName generic.
If you wanted to associated it with several generics you would use the
If you wanted to associate it with several generics you would use the
following syntax:
imeth char * gGetName, gAnotherGeneric, gAbc : get_name ()
Expand Down
2 changes: 1 addition & 1 deletion examples/exam12/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main(int argc, char *argv[])
myObj = gNew(Class1);

/* Call the SetName method via the gSetName generic. Notice that
the instance being effected is the first argument to the generic.
the instance being affected is the first argument to the generic.
This is always the case. */

gSetName(myObj, "Tom Jones");
Expand Down
2 changes: 1 addition & 1 deletion examples/exam12/readme
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ methods to similar generics. However, methods are unique to the classes
which define them, except that their functionality may be inherited by
subclassing.

When a generic is evoked, the generic determines the class of the
When a generic is invoked, the generic determines the class of the
first argument and then executes the method which is associated with
a particular generic/class combination. If an association is not found,
the superclasses of the class of the first argument are searched.
Expand Down
2 changes: 1 addition & 1 deletion examples/exam13/readme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


This example illustrates the independence one instance has from another
by creating two instances of the same class and makeing each contain
by creating two instances of the same class and making each contain
different values. The only file modified is main.c.

(To build see the readme file in the first example.)
8 changes: 4 additions & 4 deletions examples/exam14/class1.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defclass Class1 {
Since no arguments are declared, this method will only have the minimum,
and default argument 'object self'. Note, however, that in the case of
class methods, 'self' will always refer to the class object as apposed
class methods, 'self' will always refer to the class object as opposed
to an instance object as with instance methods.
The first line increments the cNumInstances class variable in order
Expand Down Expand Up @@ -83,16 +83,16 @@ cmeth int gNumInstances()
This is done because the Dispose method associated with the Object class
is the only routine which has the ability to dispose of a Dynace object.
The final line return a NULL. This is a convention which allows the
The final line returns a NULL. This is a convention which allows the
code which called the gDispose generic to NULL out the object pointer
with the same expression.
Note that prior to the definition of this method (as in the previous
examples), when the user evoked the gDispose generic on an instance of
examples), when the user invoked the gDispose generic on an instance of
this class, since no Dispose method was defined, the system automatically
executed the Dispose method associated with the Object class because
the Object class is the superclass of this class and Dynace automatically
performs this search up the inheratince hierarchy until a matching method
performs this search up the inheritance hierarchy until a matching method
is found. This is also true of the New class method defined above.
*/

Expand Down
4 changes: 2 additions & 2 deletions examples/exam14/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(int argc, char *argv[])

InitDynace(&argc);

/* Create two instances of the Class1 class. This will evoke the
/* Create two instances of the Class1 class. This will invoke the
newly defined New class method through the gNew generic. */

obj1 = gNew(Class1);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char *argv[])
printf("obj1's name is %s\n", gGetName(obj1));
printf("obj2's name is %s\n", gGetName(obj2));

/* Evoke the NumInstances class method through the gNumInstances
/* Invoke the NumInstances class method through the gNumInstances
generic. Notice that the argument passed is the class - not
an instance object. This is because class methods are associated
with classes. The returned value is printed. */
Expand Down
4 changes: 2 additions & 2 deletions examples/exam14/readme
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ defined.

Class variables differ from instance variables in that there is only one
copy of class variables and they are associated directly with the class
object (as opposed to instance objects). Therefore, when evoking class
object (as opposed to instance objects). Therefore, when invoking class
methods the first argument is always a class - not an instance.

What this example actually does is to define a class variable which
automatically keeps track of the number of instances a particular
class has in existance. The main program creates and then destroys a
class has in existence. The main program creates and then destroys a
number of instances while displaying the number of existing instances
on a periodic basis.

Expand Down
2 changes: 1 addition & 1 deletion examples/exam15/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char *argv[])
obj1 = gNewWithInt(Class1, 45);
obj2 = gNewWithInt(Class1, 36);

/* In order to insure the effectiveness of our new object's
/* In order to ensure the effectiveness of our new object's
initialization, print the code associated with each instance. */

printf("obj1's code = %d\n", gGetCode(obj1));
Expand Down
2 changes: 1 addition & 1 deletion examples/exam15/readme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


This example illustrates the procedure necessary to initialize
instance variables while creating a new instances (via gNew).
instance variables while creating a new instance (via gNew).

Class1.d is modified to give its New method the additional functionality,
and main.c is modified to utilize this changed interface to the
Expand Down
2 changes: 1 addition & 1 deletion examples/exam16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char *argv[])
obj1 = gNewWithInt(Class1, 45);
obj2 = gNewWithInt(Class1, 36);

/* In order to insure the effectiveness of our new object's
/* In order to ensure the effectiveness of our new object's
initialization, print the code associated with each instance. */

printf("obj1's code = %d\n", gGetCode(obj1));
Expand Down
2 changes: 1 addition & 1 deletion examples/exam16/readme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


This example illustrates the procedure necessary to initialize
instance variables while creating a new instances (via gNew).
instance variables while creating a new instance (via gNew).

Class1.d is modified to give its New method the additional functionality,
and main.c is modified to utilize this changed interface to the
Expand Down
2 changes: 1 addition & 1 deletion examples/exam17/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main(int argc, char *argv[])
obj1 = gNewWithInt(Class2, 45);
obj2 = gNewWithInt(Class1, 36);

/* In order to insure the effectiveness of our new object's
/* In order to ensure the effectiveness of our new object's
initialization, print the code associated with each instance. */

printf("obj1's code = %d\n", gGetCode(obj1));
Expand Down
4 changes: 2 additions & 2 deletions examples/exam17/readme
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example illustrates the process of creating a subclass.

class2.d is added and is a subclass of class1.d. No new functionality
is added at this point. main.c has been modified to show how instances
of a subclass can behaive like it's superclass.
is added at this point. main.c has been modified to show how an instance
of a subclass can behave like an instance of the superclass.

(To build see the readme file in the first example.)
2 changes: 1 addition & 1 deletion examples/exam37/readme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


This example demonstrates the creation, use and disposal of aditional
This example demonstrates the creation, use and disposal of additional
simple objects.

Notice how the same local variable can be used to represent arbitrary
Expand Down

0 comments on commit 79d7873

Please sign in to comment.