From: avi@...4.com (Avi Bryant) Date: 2002-04-23T03:33:43+09:00 Subject: Re: Ruby as Smalltalk ; wrote: > - - This seems to be the main critism of ex-smalltalkers when they > first look at Ruby. However, you can implement all those hoopy > control abstractions in Ruby, you just have to use Procs rather > than blocks. You can pass an arbitrary number of Procs to a > method. In theory. In practice, Ruby's syntax makes this awkward enough that you essentially never do it. Survey: how many people have *ever* written a method that takes two procs? The problem is a combination of a lack of keyword selectors and a heavyweight syntax for procs (the syntax for blocks is lightweight enough, but not procs). Compare this: foo detect: [:x | x < 3] ifNone: [defaultValue ifNotNil: [defaultValue] ifNil: [42]] with the (nonexistant) equivalents in Ruby: foo.detectIfNone(proc{|x| x < 3}, proc{defaultValue.ifNil(proc{42}, proc{defaultValue})}) Perhaps this is just a matter of taste, but I find the first version far more readable (and writable) than the second. I imagine other people do as well, since nobody writes code that way in Ruby; instead, they use standard (but non-extensible) control structures that do roughly the same thing. As for "Ruby as Smalltalk" in general, I'd say the main thing it's missing is not the "hoopy control structures", although those would be very nice to have. What I'd like is the Smalltalk environment, where everything in the system (from the compiler to the stack frames) is reified as an object, where modifying code on the fly is the normal (or only) mode of development, and where all the tools are written to take advantage of this. Oh, and I'd like become(). Of course, this would just be smalltalk with funny syntax and mixins, but hey, such a tool could go a long way. Cheers, Avi