From: Alex Martelli Date: 2001-04-29T21:10:09+09:00 Subject: [ruby-talk:14404] Re: Whither SmallScript? (was Re: Integer micro-benchmarks) "David Simmons" wrote in message news:sHFG6.29131$Jh5.25559611@news1.rdc1.sfba.home.com... [snip] > > a class that inherits from another class you simply have: > > > > class Foo < Bar > > def myMethod > > File.new ("test.dat", "w") { |f| > > f.puts "Hello world!" > > } > > end > > end > > A SmallScript version could be written as: > ========================================= > class name=Foo extends=Bar { > method { > myMethod > File('test.dat','w') << 'Hello world!'. > } > } And the Python equivalent would be: class Foo(Bar): def myMethod(self): open('test.dat','w').write('Hello world!\n') so there doesn't seem to be much of a difference in capabilities at this level -- very different syntax sugar, of course, but rather similar semantics. > > Here, class Foo inherits from class Bar. Except that class Bar is just an > > expression that returns a Class object. In this case it's a constant, but > > you could just as easily have: > > > > class Foo < someMagicRoutine(someArgument, somethingElse) Sure, same semantics in Python, of course. Alex