[#1263] Draft of the updated Ruby FAQ — Dave Thomas <Dave@...>

33 messages 2000/02/08

[#1376] Re: Scripting versus programming — Andrew Hunt <andy@...>

Conrad writes:

13 messages 2000/02/15

[#1508] Ruby/GTK and the mainloop — Ian Main <imain@...>

17 messages 2000/02/19
[#1544] Re: Ruby/GTK and the mainloop — Yasushi Shoji <yashi@...> 2000/02/23

Hello Ian,

[#1550] Re: Ruby/GTK and the mainloop — Ian Main <imain@...> 2000/02/23

On Wed, Feb 23, 2000 at 02:56:10AM -0500, Yasushi Shoji wrote:

[#1516] Ruby: PLEASE use comp.lang.misc for all Ruby programming/technical questions/discussions!!!! — "Conrad Schneiker" <schneiker@...>

((FYI: This was sent to the Ruby mail list.))

10 messages 2000/02/19

[#1569] Re: Ruby: constructors, new and initialise — Yukihiro Matsumoto <matz@...>

The following message is a courtesy copy of an article

12 messages 2000/02/25

[ruby-talk:01273] Re: Draft of the updated Ruby FAQ

From: Clemens Hintze <clemens.hintze@...>
Date: 2000-02-09 10:07:10 UTC
List: ruby-talk #1273
Dave Thomas writes:
> 
> Wow! Thanks for taking the time with such a detailed reply.

Thank you! For taking this responsible work of maintaining a FAQ.

> 
> Clemens Hintze <clemens.hintze@alcatel.de> writes:
> 

...

> > 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!
> 
> I don't want to change a direct quote. To be honest, if I wanted to
> delete a word in the preceedind quote, it'd be 'scripting'--I think
> Ruby's far more general that that.

I think, if it is clarified with matz you should change/correct also
parts of direct quotes of him. And he seems to agree to change it as
he has answered in [ruby-talk:01270].

See ... my English is not the best as I am not a native speaker. If I
write something to e.g. you I will not very concentrate of my English
grammar, spellings and the like...

But then, if you quote me, I would like I had more concentrate on what
I have written, you know? But regardless of how much I concentrate the
result will never be perfect!

So correction e.g. quotations of mine, I would consider as first
correcting my English, and then let me say/write/send/post this
corrected version again. And this corrected version you would take
then. :-)))

But because I would do so, and you know I would do it this way, and I
know you know... we can spare this complex scenario. Simply correct my
English in what you would like to quote from me, show it to me and ask
permission, and then quote it... :-))) We are not writing scientific
material, nor do you quote scientific material that I have written!
;-)

Of course, I only speak for myself! But I dare to guess, that matz
point-of-view would not be too different from mine in that case, would
it matz?

> > 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 
> 
> You're right. It creates the symbol, but not as a variable or method.

But then, is it important for the newbie/user to know, that a symbol
is created? What can I do with a symbol? Better not to mention it
here? Do not forget I am trying to write from a user's point-of-view.

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

...

> > I think you mean '&&' instead of &amp;&amp;, yes? I do not know right
> > now, but can I overload '||'? I do not think so.
> 
> Just slightly over quoted ;-)  Fixed

Additionally matz has stated, that '~' and '|' *can* be overloaded.

> > 5.7 What's the difference between private and protected? 
> > 
> > But the visibility thing is the same? That means protected is somewhat
> > superfluos, isn't it (from the newbie point-of-view)?
> 
> No, because (for example)
> 
>    def <=>(other)
>      func <=> other.func
>    end

Ahh! :-O This I had not thought! Nice, really! :-)

> 
> will work if 'func' is protected, but not if it's private. I've added
> an example.

But in this example you have not even mentioned the word 'protected' ;-)

> What can I say. 's' and 'd' _are_ next to each other on the keyboard.

:-))))

...

> > 7.21 Does Ruby have function pointers? 

...

> But a variable pointing to a proc object is effectively a function
> pointer (or at least is used in the same way function pointers
> are). I've changed the wording a tad.

The new description is much better :-)

> 
> >    o thread does not cause thrashing. 
> > 
> > What does that mean in opposition to processes spawned with 'fork'?
> 
> Just that fork may cause thrashing.

:-/ That was not very helpful to me. But matz has already explained
it to me, what thrashing mean here! :-)

...

So this were the answers to your remarks! No I will add remarks to the
corrected FAQ!

2.2 What is the scope of a local variable? 
    A block (``{'' ... ``}'' or do ... end) introduces creates a new
    scope, ...

First, please delete 'create' or 'introduce'.  Second, I would
reformulate it so that it mention all scope creators in the first
sentence (blocks also). Then I would like to have an example for every
creator. I, for example, cannot imagine what you mean by saying
'(main)'? I know, however, what you mean with 'toplevel' ;-)

The last sentence beginning with 'while, until, and ...' could also be
attached above the examples. So seeing the examples, I would have
already read the whole description. I do not like, that a description
is spread thru many sections. Only if it is a complex one, that would
be appropiate, IMHO.

3.3 How is a block used in an iterator?

You have mentioned here three ways! But if I see this 'Proc.new.call'
thingy I feel you should also mention the 'proc' and 'lambda'
constructs. Then we have five ways and more examples ;-)

    (3b) def myIterator(b=Proc.new)
             b.call(2,3)
         end
    (4a) def myIterator(b=proc)
             b.call(2,3)
         end
    (4b) def myIterator
             proc.call(2,3)
         end
    (5a) def myIterator(b=lambda)
             b.call(2,3)
         end
    (5b) def myIterator
             lambda.call(2,3)
         end

Although you mention 'proc' and 'lambda' in the last example, I feel
they deserve own examples. A further hint you could give, would be:
attached blocks are not consumed! I was struggle about that in my
beginning. Only because of that fact, your last example is possible!

...

6.6 What is a singleton class?

Has all this about 'anonymous classes' to be mentioned here? I feel
your second example should be called something like 'object
extension'. That there are used 'anonymous classes' used to do that,
is regardless for the user/newbie. He even cannot find it simply out,
as 'anchestors' would not show this 'anonymous class'.


HTH!

Much fun,
\cle.

In This Thread