@@ -229,19 +229,20 @@ I'll explain them one by one.
229229
230230h4. Small integers
231231
232- As in Ruby all data are objects, integers are also objects. However, as there
233- are lots of different instances of integers, expressing them as structures
234- would risk slowing down execution. For example, when incrementing from 0
235- to 50000, just for this creating 50000 objects would make us hesitate.
232+ Just like in Ruby itself, all data are objects. Likewise, integers are objects.
233+ However during normal program execution, lots of instances of integers are
234+ created. Using structures to express them would risk slowing down execution. For
235+ example, if we created 50000 objects when incrementing from 0 to 50000 we'd
236+ definitely have to consider the performance issues.
236237
237238That's why in `ruby`, to some extent, small integers are treated specially and
238- embedded directly into `VALUE`. "small " means signed integers that can be held
239+ embedded directly into `VALUE`. "Small " means signed integers that can be held
239240in `sizeof(VALUE)*8-1` bits. In other words, on 32 bits machines, the integers
240241have 1 bit for the sign, and 30 bits for the integer part. Integers in this
241242range will belong to the `Fixnum` class and the other integers will belong to
242243the `Bignum` class.
243244
244- Then, let 's see in practice the `INT2FIX()` macro that converts from a C `int`
245+ Let 's see in practice the `INT2FIX()` macro that converts from a C `int`
245246to a `Fixnum`, and confirm that `Fixnum` are directly embedded in `VALUE`.
246247
247248▼ `INT2FIX`
@@ -269,7 +270,7 @@ containing `NUM` can manage both `Fixnum` and `Bignum`. For example if
269270`INT2NUM()` can't convert an integer into a `Fixnum`, it will automatically
270271convert it to `Bignum`. `NUM2INT()` will convert both `Fixnum` and `Bignum` to
271272`int`. If the number can't fit in an `int`, an exception will be raised, so
272- there is not need to check the value range.
273+ there is no need to check the value range.
273274
274275h4. Symbols
275276
@@ -299,11 +300,11 @@ troublesome to handle all of them as strings (`char*`), because of memory
299300management and memory management and memory management... Also, lots of
300301comparisons would certainly be necessary, but comparing strings character by
301302character will slow down the execution. That's why strings are not handled
302- directly, something will be associated and used instead. And generally
303+ directly, something will be associated and used instead. And generally that
303304"something" will be integers, as they are the simplest to handle.
304305
305306These `ID` are found as symbols in the Ruby world. Up to `ruby 1.4`, the
306- values of `ID` where converted to `Fixnum`, but used as symbols. Even today
307+ values of `ID` were converted to `Fixnum`, but used as symbols. Even today
307308these values can be obtained using `Symbol#to_i`. However, as real use results
308309came piling up, it was understood that making `Fixnum` and `Symbol` the same
309310was not a good idea, so since 1.6 an independent class `Symbol` has been
@@ -378,10 +379,11 @@ For `Qnil`, there is a macro dedicated to check if a `VALUE` is `Qnil` or not,
378379
379380The name ending with `p` is a notation coming from Lisp denoting that it is a
380381function returning a boolean value. In other words, `NIL_P` means "is the
381- argument `nil`?". It seems the "`p`" character comes from "predicate". This
382+ argument `nil`?". It seems the "`p`" character comes from "predicate." This
382383naming rule is used at many different places in `ruby`.
383384
384- Also, in Ruby, `false` and `nil` are false and all the other objects are true.
385+ Also, in Ruby, `false` and `nil` are falsy (that is, they count as false in
386+ conditional statements) and all the other objects are truthy.
385387However, in C, `nil` (`Qnil`) is true. That's why in C a Ruby-style macro,
386388`RTEST()`, has been created.
387389
@@ -401,7 +403,7 @@ requirements of the glib library that only wants 0 or 1
401403("[ruby-dev:11049]":http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/11049).
402404
403405By the way, what is the '`Q`' of `Qnil`? 'R' I would have understood but why
404- '`Q`'? When I asked, the answer was "Because it's like that in Emacs". I did
406+ '`Q`'? When I asked, the answer was "Because it's like that in Emacs." I did
405407not have the fun answer I was expecting...
406408
407409h4. `Qundef`
@@ -419,10 +421,10 @@ be found at all at the Ruby level.
419421
420422h2. Methods
421423
422- I already brought up the three important points of a Ruby object, that is
423- having an identity, being able to call a method, and keeping data for each
424- instance. In this section, I'll explain in a simple way the structure linking
425- objects and methods.
424+ I already brought up the three important points of a Ruby object: having an
425+ identity, being able to call a method, and keeping data for each instance. In
426+ this section, I'll explain in a simple way the structure linking objects and
427+ methods.
426428
427429h3. `struct RClass`
428430
0 commit comments