Ovid's journal got me thinking about the multi-mixin problem again. That got me thinking about selector namespaces again, too.
Consider the current mixin behavior:
module Alpha
def hello
puts "Alpha"
end
end
module Beta
def hello
puts "Beta"
end
end
class Tango
include Alpha
include Beta
end
Tango.new.hello # => "Beta"
Possible solutions:
* First method definition wins * Last method definition wins, raises a warning * No one wins, it's an error
And my new, crazy idea:
* First method definition wins, later methods are auto-namespaced
# Let's assume this syntax actually works
t = Tango.new
t.hello # => "Alpha" (wins, first definition)
t.hello:alpha # => "Alpha" (same, but explicit)
t.hello:beta # => "Beta" (calls Beta module's method)