@@ -52,7 +52,7 @@ Ruby array class, `Array`, as an example.
5252to `ruby` and the `c` that it is a class object. These naming rules
5353are used everywhere in `ruby`.
5454
55- This call to `rb_define_class()` allows to define `Array` that
55+ This call to `rb_define_class()` defines a class called `Array`, which
5656inherits from `Object`. At the same time as `rb_define_class()` creates
5757the class object, it also defines the constant. That means that after this
5858you can already access `Array` from a Ruby program. It corresponds to
171171
172172h3. Singleton methods definition
173173
174- We can define methods that are specific to an instance of an
175- object. They are called singleton methods. As I used `File.unlink` as
174+ We can define methods that are specific to a single object instance.
175+ They are called singleton methods. As I used `File.unlink` as
176176an example in chapter 1 "Ruby language minimum", I first wanted to
177177show it here, but for a particular reason we'll look at `File.link`
178178instead.
@@ -217,7 +217,7 @@ made:
217217(array.c)
218218</pre>
219219
220- The `Init` for the built-in functions are explicitely called during
220+ The `Init` for the built-in functions are explicitly called during
221221the startup of `ruby`. This is done in `inits.c`.
222222
223223▼ `rb_call_inits()`
@@ -244,7 +244,7 @@ the startup of `ruby`. This is done in `inits.c`.
244244
245245This way, `Init_Array()` is called properly.
246246
247- That explains it for built-in libraries, but what about extension
247+ That explains it for the built-in libraries, but what about extension
248248libraries? In fact, for extension libraries the convention is the
249249same. Take the following code:
250250
@@ -255,7 +255,7 @@ require "myextension"
255255With this, if the loaded extension library is `myextension.so`, at
256256load time, the (`extern`) function named `Init_myextension()` is
257257called. How they are called is beyond the scope of this chapter. For
258- that, you should read the chapter 18 "Load". Here we'll just end this
258+ that, you should read chapter 18, "Load". Here we'll just end this
259259with an example of `Init`.
260260
261261The following example is from `stringio`, an extension library
@@ -317,7 +317,7 @@ level.
317317h3. `rb_singleton_class()`
318318
319319Well, let's confirm what the singleton classes are made of. It's too
320- simple to each time just show you the code of function so this time
320+ simple to just show you the code of a function each time so this time
321321I'll use a new weapon, a call graph.
322322
323323<pre class="emlist">
@@ -458,7 +458,7 @@ rb_singleton_class
458458Here also `rb_class_boot()` is called. So up to that point, it's the
459459same as in normal classes. What's going on after is what's different
460460between normal classes and singleton classes, in other words the
461- characteristics of singleton classes. If you everything's clear so
461+ characteristics of singleton classes. If everything's clear so
462462far, we just need to read `rb_singleton_class()` and
463463`rb_make_metaclass()`.
464464
@@ -523,7 +523,7 @@ half.
523523
524524Everything that is handled in the first half are non-pointer `VALUE`s,
525525in other words objects without an existing C structure. First,
526- `Fixnum` and `Symbol` are explicitely picked. Then,
526+ `Fixnum` and `Symbol` are explicitly picked. Then,
527527`rb_special_const_p()` is a function that returns true for non-pointer
528528`VALUE`s, so there only `Qtrue`, `Qfalse` and `Qnil` should get
529529caught. Other than that, there are no valid non-pointer value so a bug
@@ -779,7 +779,7 @@ this logic.
779779h4. "Class is also an object"
780780
781781"Everything is an object" is often used as advertising statement when
782- speaking about Ruby. And as a part of that, "Classes are also object !"
782+ speaking about Ruby. And as a part of that, "Classes are also objects !"
783783also appears. But these expressions often go too far. When thinking
784784about these sayings, we have to split them in two:
785785
@@ -1197,7 +1197,7 @@ After `rb_define_class_id`, we can find the following:
11971197st_add_direct(rb_class_tbl, id, klass);
11981198</pre>
11991199
1200- This part assigns the class to the constant. However, whichever the
1200+ This part assigns the class to the constant. However, whichever
12011201way you look at it you do not see that. In fact, top-level classes are
12021202separated from the other constants and regrouped in
12031203`rb_class_tbl()`. The split is slightly related to the GC. It's not
@@ -1355,7 +1355,7 @@ If you create a class like this, we won't go through
13551355`rb_define_class_id()` and the classpath won't be set. In this case,
13561356`c` does not have any name, which is to say we get an unnamed class.
13571357
1358- However, if later it's assigned into a constant, the name of this
1358+ However, if later it's assigned to a constant, the name of this
13591359constant will be attached to the class.
13601360
13611361<pre class="emlist">
0 commit comments