[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6457] comp.lang.python "Ruby and Python" thread item

From: "Conrad Schneiker" <schneik@...>
Date: 2000-11-20 11:46:40 UTC
List: ruby-talk #6457
Hi,

There is an interesting comp.lang.python "Ruby and Python" thread, wherein 
John Dell'Aquila recently wrote:

> June Kim  wrote:
> > Has anyone used Ruby here? or are there some documents at least
> unbiased --
> > yet,  Python-centric view would be okay if not too fictional.
> 
> Ruby is Smalltalk with Perlish syntax.
> Python is ... (this is c.l.p., you fill in the blank)
> 
> Python and Ruby are both object oriented languages that provide a
> smooth transition from procedural to OO programming styles. Smalltalk,
> by contrast, is object only - you can't do anything until you understand
> objects, inheritance and the sizable Smalltalk class hierarchy. By
> providing procedural training wheels, Python and Ruby "fix" one of
> the features that may have kept Smalltalk out of the mainstream.
> The two languages differ by approaching this solution from
> opposite directions.
> 
> Python is a hybrid language. It has functions for procedural
> programming and objects for OO programming. Python bridges
> the two worlds by allowing functions and methods to interconvert
> using the explicit "self" parameter of every method def. When a
> function is inserted into an object, the first argument automagically
> becomes a reference to the receiver.
> 
> Ruby is a pure OO language that can masquerade as a procedural one.
> It has no functions, only method calls. In a Ruby method the receiver,
> also called self, is a hidden argument like "this" in C++. A "def"
> statement outside of a class definition, which is a function in
> Python, is actually a method call in Ruby. These ersatz functions
> become private methods of class Object, the root of the Ruby class
> hierarchy. Procedural programming is neatly solved from the other
> direction - everything is an object. If the user doesn't grok objects
> yet, they can just pretend that "def" is a function definition and
> still get useful work done.
> 
> Ruby's OO purity provides a number features that Python lacks or is
> still workng toward: a unified type / class hierarchy, metaclasses,
> the ability to subclass *everything*, and uniform method invocation
> (none of this len() is a function but items() is a method rubbish).
> Ruby, like Smalltalk, only supports single inheritance, but it does
> have a very powerful mixin concept: a class definition may
> include a module, which inserts that module's methods, constants,
> etc. into the class.
> 
> Ruby, again like Smalltalk, provides closures and code blocks and uses
> them to the same good effect. The Ruby collection classes and
> iterators are outstanding, much more powerful and elegant than the ad
> hoc solutions that Python is sprouting (lambdas and list 
comprehensions).
> 
> Ruby's syntax and design philosophy are heavily influenced by Perl. It
> has a lot of syntactic variability. Statement modifiers (if, unless,
> while, until, etc.) may appear at the end of any statement. Some key
> words are optional (the "then" in an "if" statement for example).
> Parentheses may sometimes be elided in method calls. The
> receiver of a method may usually be elided.  Many, many things are
> lifted directly from Perl. Built in regular expressions, $_ and
> friends, here documents, the single-quoted / double-quoted string
> distinction, $ and @ prefixes to distinguish different kinds of names
> and so forth.
> 
> If you like Perl, you will like Ruby and be right at home with its
> syntax. If you like Smalltalk, you will like Ruby and be right at home
> with its semantics. If you like Python, you may or may not be put off
> by the huge difference in design philosophy between Python and
> Ruby/Perl.
> 
> Ruby is much more complex than Python but its features, for
> the most part, hang together well. Ruby is well designed and full
> of neat ideas that might be mined for P3K. I'm not sure how many
> Python programmers will be attracted to it though - it hasn't won me
> over (yet). But it is worthy of serious study and could be a real threat
> to Perl.

Conrad Schneiker
(This note is unofficial and subject to improvement without notice.)

In This Thread

Prev Next