From: Daniel Berger Date: 2010-04-21T21:37:13+09:00 Subject: [ruby-core:29685] Re: "include X; include Y" vs "include X, Y" Shugo Maeda wrote: > Hi, > > 2010/4/21 Daniel Berger : >> It seems that when including multiple modules with identical method >> names there are different results when using multiple includes versus >> a single include with multiple arguments. In the the former case we >> get a "last method definition wins" but in the latter it's "first >> method definition wins". >> >> Is this expected behavior? If so, where is it documented? > > It is intended. > > The behavior of `include X, Y' was initially the same as `include X; > include Y', but the order of inclusion was changed to the same order > as the return value of Module#ancestors. > > module Foo > end > module Bar > end > class Baz > include Foo, Bar > end > p Baz.ancestors #=> [Baz, Foo, Bar, Object, Kernel] Interesting, thanks. Dan