It seems "hack"-like features are defined as "things that could have been done in a library but ended up as part as the syntax instead".
Strictly speaking, the "*" operator is part of the standard library in Ruby, and not part of the language. If you wanted to write it yourself, rather than using the library version, you could use the following code...
class String
def *(number)
result = ""
number.times { result << self }
return result
end
end
Yes that I can see, but what about the favorable differences.
Here's a few.
o Smalltalk-like object system, including a unified type system
o Metaclasses
o Full closures
o Eiffel like syntax (not indentation based... Ok, whether this counts as favorable or not depends upon your taste:-)
o Continuations
I understand that Python community is working on unifying its current type system, and providing lexical scoping for closures. I suspect the languages will grow closer to each other as time goes on.
Both Ruby and Python are excellent languages, with more simularities than differences.
There is a DBI module at http://www.ruby-projects.org/dbi/ . There are also a number of DB specific modules. See the Ruby Application Archive ( http://www.ruby-lang.org/en/raa.html ) for a list of other software modules that are available for Ruby.
Strictly speaking, the "*" operator is part of the standard library in Ruby, and not part of the language. If you wanted to write it yourself, rather than using the library version, you could use the following code ...
class String
def *(number)
result = ""
number.times { result << self }
return result
end
end
Yes that I can see, but what about the favorable differences.
... Ok, whether this counts as favorable or not depends upon your taste :-)
Here's a few.
o Smalltalk-like object system, including a unified type system
o Metaclasses
o Full closures
o Eiffel like syntax (not indentation based
o Continuations
I understand that Python community is working on unifying its current type system, and providing lexical scoping for closures. I suspect the languages will grow closer to each other as time goes on. Both Ruby and Python are excellent languages, with more simularities than differences.
There is a DBI module at http://www.ruby-projects.org/dbi/ . There are also a number of DB specific modules. See the Ruby Application Archive ( http://www.ruby-lang.org/en/raa.html ) for a list of other software modules that are available for Ruby.