Python <=> ruby

FYI, I found this while googling:

www.cs.washington.edu/homes/kd/courses/pythonruby.pdf

Christian Szegedy wrote:

FYI, I found this while googling:

www.cs.washington.edu/homes/kd/courses/pythonruby.pdf

See the thread starting at http://www.ruby-talk.org/blade/37840

Just joking :slight_smile:

···


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

All the existing 2.0.x kernels are to buggy for 2.1.x to be the
main goal.
– Alan Cox

“Christian Szegedy” szegedy@t-online.de wrote in message
news:an4t5r$fh$01$1@news.t-online.com

FYI, I found this while googling:

www.cs.washington.edu/homes/kd/courses/pythonruby.pdf

The above discusses the uniform access of everything is an object and
compares to Java: Math.abs versus -3.abs in Ruby.

This reveals something I’ve only slowly grown to realize in OOP: It’s no so
much that objects have methods as it is the fact that the object does all
the scope resolution for you. You can have ten different functions of the
same name but the object always know which one is relevant.

When comparing at functional language like OCaml (ignoring it’s object
system) to Ruby, it doesn’t really matter whether you write “find obj 2” or
you write “obj.find 2”. However, it does matter whether you write “Hash.find
obj 2” or you write “List.find obj 2”. In other words, the functional style
requires you to know what kind of an object you are dealing with and use the
correct find function. But this is rendundant as the object already knows
it, regardless of static or dynamically typed (except OCaml sometimes
derives the type of the object based on the formal argument types of the
function).

Templates and generics deals with the above problem. Templates require the
object to be typed wheras Ruby stores the available functions in a class,
which is essentially just making the type lookup at a different space and
time.

Perhaps OO is more about scope than it is about objects and perhaps a new
language could be designed to work on scopes rather than objects. I already
see Ruby as more of a scope managing system than an OO language. If you look
at Lua there is a few things in common, but Lua does not manage scope,
whereas Ruby does in the concept of objects and classes.

Mikkel

Joel VanderWerf wrote:

See the thread starting at http://www.ruby-talk.org/blade/37840

Sorry! I was too quick.

Hello MikkelFJ,

Sunday, September 29, 2002, 3:31:33 PM, you wrote:

When comparing at functional language like OCaml (ignoring it’s object
system) to Ruby, it doesn’t really matter whether you write “find obj 2” or
you write “obj.find 2”. However, it does matter whether you write “Hash.find
obj 2” or you write “List.find obj 2”. In other words, the functional style
requires you to know what kind of an object you are dealing with and use the

no, it’s dealed by overloading mechanism

···


Best regards,
Bulat mailto:bulatz@integ.ru

Bulat Ziganshin wrote:

Hello MikkelFJ,

Sunday, September 29, 2002, 3:31:33 PM, you wrote:

When comparing at functional language like OCaml (ignoring it’s object
system) to Ruby, it doesn’t really matter whether you write “find obj 2” or
you write “obj.find 2”. However, it does matter whether you write “Hash.find
obj 2” or you write “List.find obj 2”. In other words, the functional style
requires you to know what kind of an object you are dealing with and use the

no, it’s dealed by overloading mechanism

OCaml has no overloading. but it would badly need it, I have seen
an experimental implementation of it, but only for an older version
of OCaml.

Regards, Christian