I'm still digesting the vocabulary thread, but while I do, let me ask a
question that's probably crystal clear to everyone else.

Do roles act as a form of mix-in, as Ruby modules may, and Objective-C
protocols do?

Would the following two snippets be at all equivalent?

# Perl6
role Talk {
   method say_hello {
      print "Hello world!\n"
   }
}

class Foo does Talk { ... }

Foo.new.say_hello;

# Ruby
module Talk
   def say_hello
      puts "Hello world!"
   end
end

class Foo
   include Talk
end

Foo.new.say_hello

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 11/27/2003


Reply via email to