Automatically filter by namespaces when possible

Partly fix the question raised at https://github.com/hoaproject/Compiler/pull/33.