What if I import two modules, both of which export a 'foo' method?

IMHO, it would be nice if this sort of situation was resolved in a
manner similar to how role composition occurs: call such a conflict a
fatal error, and provide an easy technique for eliminating such
conflicts.  One such technique would be to allow the import list to
rename items by means of Pairs: any Pair that occurs in the import
list uses its key as the item's old name and its value as the new
name.  Thus,

   use Foo (foo => 'bar');
   use Bar (:foo<baz>);

would import 'foo' from 'Foo', but it would appear in the current
lexical scope as 'bar'.  Likewise, it would import 'foo' from Bar, but
would rename it as 'baz'.

Another possibility would be to supply a substitution rule that
transforms the names.

--
Jonathan "Dataweaver" Lang

Reply via email to