From: Gary Wright Date: 2009-02-28T00:42:01+09:00 Subject: [ruby-core:22572] Re: YASNP (Yet Another Selector Namespace Proposal) On Feb 27, 2009, at 12:58 AM, Charles Oliver Nutter wrote: > I thought I'd sent this before...hopefully it's still relevant. > > Here's a perfect example, also based on rake: "import" > > JRuby added an "import" for Java classes that ends up conflicting > with the "import" Rake uses. So we've had no end of hassle because > we both want that top-level "import" name and both of them do > drastically different things. If we had namespaces, people could > have avoided this very easily: > > import "my_other_rakefile" > > using JRuby::Import > import java.lang.System > end > > As it stands, we had to add yet ANOTHER name to import stuff, > "import_java". I think it is helpful to have concrete examples like this. This example illustrates a reason why the 'to-end-of-file' scoping rules might be a bit heavy-handed as it would become impossible to mix and match the use of rake's 'import' and JRuby's 'import'. The syntax you use above, while verbose, does give you a way to access either version of 'import' at any point in the source.