name-conflict

Why do pascal forbid same identifier name for method's parameter and class's data member?

type TPerson = class(TObject) name : string; constructor create(name : string); end; would trigger compiler error. I think a self or this pointer/reference is good enough,for its clarity.So,what are the advantages of doing so? EDIT: One more question,could you show what are the other languages that depoly this...

Why can't java use thread context classloader when a method is literally called?

I've written a custom classloader 'JarClassLoader', which itself works ok, since the following test case is green: public void testJarClassLoader() throws Exception { JarClassLoader cl = new JarClassLoader(); cl.addURLsByClassPath("lib/a-lot-of-jars.jar|lib/more-jars.jar", "\\|"); Class c = cl.loadClass("com.packagepath.cla...

How to manage several python subprojects with setuptools?

I'm wondering about the correct/easiest/most pythonic way of dealing with subprojects that you want have using the same base package. We currently have a file structure like this: trunk\ proj1\setup.py company_name\__init__.py + proj1's code proj2\setup.py company_name\__init__.py + proj2's code We want to ...

How to resolve a name collision between a C++ namespace and a global function?

Hi, if I define a namespace log somewhere and make it accessible in the global scope, this will clash with double log(double) from the standard cmath header. Actually, most compilers seem to go along with it -- most versions of SunCC, MSVC, GCC -- but GCC 4.1.2 doesn't. Unfortunately, there seems no way to resolve the ambiguity, as usi...