(Wandering sorta OT) here's my list of python v ruby http://blog.ianbicking.org/ruby-python-power.html http://www.ruby-doc.org/RubyEyeForThePythonGuy.html http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc http://www.approximity.com/ruby/Comparison_rb_st_m_java.html http://reflectivesurface.com/weblog/2004/12/19/why-rails look at Amazon's used books. Ruby way used: $20 (well worth it, it has a python to ruby appendix) Cheapest used copies of Pickax2 are only $2 less than new copies. This speaks well for the value of that book, I think. Elf M. Sternberg wrote: > I'm afraid that I'm coming from Python, a B&D language where I'm used to > everything be spelled out cleanly, and although I programmed in Perl for > many years that was also many years ago. Ruby is baffling the heck out > of me. > > I've been looking at two examples, and I was wondering if someone could > explain to me what the Hell is going on. The first is from > http://redhanded.hobix.com/bits/hyperextended.html, and my question is > about the 'extend' keyword there. Where does that came from? In what > object is it defined? It's just hanging there in space. In the same > breath, what does the 'super' keyword do in the append_features() > method, and why does it need a 'self' in front of it? I've tried > reading ruby-docs without finding much illumination. > > module Mix > def inst_meth > puts 'inst_meth' > end > > module ClassMethods > def class_meth > puts 'class_meth' > end > end > > extend ClassMethods > > def self.append_features(klass) > super > klass.extend(ClassMethods) > end > end > > > Second, I've seen the following constructions: > > validates :url :with => %r{^http:.+\.(gif|jpg|png)$}i > > and > > check_associations %w(friends downloads links) > > I'm guessing that the "%r" and "%w" are the ruby equivalents of perl's > qr{} and qw{} constructs (does this mean there's a %qq() and %qx() as > well?), but I can't find documentation to that effect inside the > references available on-line. (And before someone says "Buy the > Pickaxe!" I'll just say that I spent my book budget this month on the > Rails book and any other purchases will have to wait until my next > paycheck.) > > Thanks! > > Elf