Hello,

I have been thru your Ruby FAQ. Good work! :-) I have some things to
mention. All my comments are made bearing in mind, what is meaningful
for the user not the guru (I hope). Lacking higher English skills, it
may also be that I have misunderstood/interpreted some of the
sentences I have comments given to. Sorry in that case.

And now here we are ...

GENERAL REMARKS

- May I propose that Ruby code samples are *not* enclosed in <HR>
  tags. It is difficult for my eyes to recognize that all these parts
  belonging to the same answer! IMHO, different font (and/or
  additional indentation) for Ruby code should be enough.


SPECIAL REMARKS


1.4 What is the history of Ruby?
   ... wanted a genuine object-oriented, easy-to-use object-oriented
   scripting language.

Perhaps delete one 'object-oriented'? If matz agrees, of course!


2.1 Does assignment generate a new copy of an object? 
   ... All variables ... If they have not been initialized, they
   reference the object nil. ...

This is not true for local variables. If they wasn't initialized, they
are void. It is an error to use them!


2.2 What is the scope of a local variable? 
   ... A procedure block creates ...

Not only a procedure block. Every block does, AFAIK. As you have not
explained, what procedure block means, I assume procedure block mean
definition block of methods.


2.6 Does assignment to a formal argument influence the actual argument? 
   A formal argument is a local variable. Within a method, assigning
   to a formal argument simply changes the object to which it points.

Could that be misunderstanding? I would understand this as: actual
argument points to object A. Formal argument also. Now assignment to
formal argument happens so object A is changed. That would be wrong! I
assume you mean: formal argument now points to new object, whereas
actual argument still points to A, yes?


2.9 What does ``&'' prepended to an argument mean?
   The ampersand character tells Ruby to expect a Proc object in place
   of this parameter. A block following the method call will be
   converted into a Proc object and assigned to the formal parameter.

I think the main purpose of that feature is reflected by the second
sentence. Reading the first sentence could cause misunderstandings.
If you pass Proc instances to a method, you would not have to pass
them to a '&' prefixed parameter. You could simply pass it to every
argument you like, because a Proc instance is merely an object like
nearly all things in Ruby.

Furthermore, if you prepend the '&' to an actual parameter *and* this
parameter refer to a Proc instance, this Proc instance will be
converted to a block and can so be called via 'yield' by that method.


2.10 Can I define a default value for a formal argument? 

Better reformulate it to "2.10 How can I define ..."?


3.1 What is an iterator? 
   An iterator is a method which is passed a block ...

IMHO, blocks are not passed, but attached to methods. If they would be
passed, it could mean that they also are objects. But I feel they are
not, at least not in Ruby's sense of objects.


3.3 How is a block used in an iterator? 
   There are three ways to execute a block from an iterator method:
   ... (3) using Proc.new.

Proc.new creates an Proc instance from a attached block. But it does
not execute it. This has do be done via 'call' anyway.

   If a method definition ... , it will receive the block object. The
   block may be called using method.call(args...).

Blocks are not objects. At least not in the Ruby's sense of
objects. Furthermore the only way to call a block is via 'yield'. In
this example the block is not a block anymore. It is a Proc instance
whose 'call' method has to be invoked to call it.

   Proc.new, ..., generates a procedure object from it. (proc and
   lambda are effectively synonyms.)

There are no procedure objects in Ruby. What is meant here are Proc
instances.


4.1 What does :var mean? 
   A colon followed ..., but the ``:'' form will create a local
   variable if it doesn't already exist.

I could not verify it! I have tried 

   ruby -e 'def ttt; p :a; p a; end; ttt'
   /tmp/rb4haGUE:1:in `ttt': undefined local variable or method `a' for ...


4.10 What's the difference between ``or'' and ``\\''? 

I guess the ``\\'' should be ''||'', shouldn't them?


5.2 Are +, -, * ... operators? 

   However, the following are built-in control structures, not
   methods, which cannot be overridden.

   =, .., ..., !, not, &amp;&amp;, and, |, or, ~, ::

I think you mean '&&' instead of &amp;&amp;, yes? I do not know right
now, but can I overload '||'? I do not think so.


5.7 What's the difference between private and protected? 

I had not know the 'private' thing :-) The description of this
section, however, sounds like diffusing to me. The only difference
between private and protected is, that protected allow to have an
explicite receiver in its call syntax, whereas private only allow
implicite ones?

But the visibility thing is the same? That means protected is somewhat
superfluos, isn't it (from the newbie point-of-view)?


5.14 Why can destructive methods be dangerous? 
   ...invoke a destructive method, the object references by all of
   them will be changed.

Shouldn't that be '... the object referenced by ...'?


6.3 What is a class instance variable? 
   ... There is no way to access class instance variables from
   instance methods.

That is not true so. They could access them via Singleton methods! So
better add 'directly'.


7.21 Does Ruby have function pointers? 
   A Proc object generated by Proc.new, proc, or lambda serves as a
   function pointer. You can also get references to methods within a
   particular object instance using Object.method.

Hmmm! This is not the same, IMO. A function pointer is a variable that
points to a certain function. This function could be executed by
calling it thru this variable. At any time you may let the variable
point to another function. A Proc instance, cannot serves this
pupose. A Proc instance *is* a callable object. But it cannot points
to another one.


7.22 What is the difference between thread and fork? 
   ... 
   Thread and fork have following characteristics: 
   ...
   o thread does not cause thrashing. 

What does that mean in opposition to processes spawned with 'fork'?


8.1 How can I use Ruby interactively? 

Another possibility is to use: "ruby -rdebug -e0" which can be used
for simple things. But 'irb' is much more useful. :-)


Much fun,
\cle