[#1215] Tk widget demo; English Tk docs?; Java 1.2 Swing — "Conrad Schneiker" <schneiker@...>
Hi,
[#1218] Trivial FAQ bug — Dave Thomas <Dave@...>
[#1229] A vote for old behavior — Dave Thomas <Dave@...>
[#1232] Any FAQ requests, updates, ... — Dave Thomas <Dave@...>
[#1233] Singleton classes — Dave Thomas <Dave@...>
[#1263] Draft of the updated Ruby FAQ — Dave Thomas <Dave@...>
[#1307] Ruby/GTK 0.23 released — Hiroshi IGARASHI <igarashi@...>
Hi all,
From: Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp>
From: "Conrad Schneiker" <schneiker@jump.net>
On Fri, Feb 18, 2000 at 09:37:27PM -0500, Yasushi Shoji wrote:
[#1322] FAQ: Ruby acronyms — "Conrad Schneiker" <schneiker@...>
In the spirit of TABWTDI (there are better ways to do it), I'd like to
[#1341] Vim syntax file — Mirko Nasato <mirko.nasato@...>
Hi,
On Mon, Feb 14, 2000 at 05:44:39PM +0100, Mirko Nasato wrote:
[#1354] Say hi (bis) — Pixel <pixel_@...>
hi all,
[#1355] nice sample for functional stuff — Pixel <pixel_@...>
what about having map in standard (and map_index too)?
[#1373] Ruby Language Reference Manual--Glossary — "Conrad Schneiker" <schneiker@...>
I was going to print the Ruby Language Reference Manual when I noticed that
[#1376] Re: Scripting versus programming — Andrew Hunt <andy@...>
Conrad writes:
[#1379] Re: Yield — Andrew Hunt <andy@...>
>From: "Conrad Schneiker" <schneiker@jump.net>
[#1384] Re: Say Hi — mengx@...
My suggestion was to try to find a more comfortable method name (to me, and
[#1392] Re: Some Questions - Parameterised Types / Invariants — Andrew Hunt <andy@...>
>1. Parameterised Types / Template Classes
[#1398] Bignum aset — Andrew Hunt <Andy@...>
[#1488] Discussion happens on news.groups — Clemens Hintze <c.hintze@...>
Hi,
[#1508] Ruby/GTK and the mainloop — Ian Main <imain@...>
Hello Ian,
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.))
From: "Conrad Schneiker" <schneiker@jump.net>
[#1528] ruby <=> python — Quinn Dunkan <quinn@...>
Hello! I'm new to ruby-talk, and mostly new to ruby. I'm making a document
[#1551] Ruby thread scheduling buglet — Ian Main <imain@...>
[#1569] Re: Ruby: constructors, new and initialise — Yukihiro Matsumoto <matz@...>
The following message is a courtesy copy of an article
[#1591] Certain char's not recognized by "." in regex? — Wes Nakamura <wknaka@...>
[#1592] Race condition in Singleton — Dave Thomas <Dave@...>
[ruby-talk:01268] Draft of the updated Ruby FAQ
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, &&, and, |, or, ~, :: I think you mean '&&' instead of &&, 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