A quote from Guido van Rossum

— Paul Annesley, February 2009

Although I had hoped to provide something similar in Python, it quickly became clear that such an approach would be impossible because there was no way to elegantly distinguish instance variables from local variables in a language without variable declarations.

— Guido van Rossum, The History of Python: Adding Support for User-defined Classes

# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  def salute
    puts "Hello #{@name}!"

— Ruby example, ruby-lang.org front page


← index