January 02, 2013
On Wednesday, January 02, 2013 19:27:31 Russel Winder wrote:
> I am finding that I cannot have a function of the same name as a module using D. Is this just me missing something or is it right that module names and function names are in the same name category?

AFAIK, it works just fine. It's just that if you use the name by itself, it's going to find the module, so you need to use the full import path to use the function. IIRC, the last time that it came up, Walter said that that's how it's intended to work, but I'd have to go digging through the archives to be sure of what he said exactly.

- Jonathan M Davis
January 02, 2013
On Wed, Jan 02, 2013 at 07:27:31PM +0000, Russel Winder wrote:
> I am finding that I cannot have a function of the same name as a module using D. Is this just me missing something or is it right that module names and function names are in the same name category?
[...]

A somewhat ugly workaround is this:

--- abc.d ---
	module abc;
	void abc() { ... }

--- main.d ---
	import abc : abc;	// force function name to override module name
	void main() {
		abc();		// this should work
	}


T

-- 
Laissez-faire is a French term commonly interpreted by Conservatives to mean 'lazy fairy,' which is the belief that if governments are lazy enough, the Good Fairy will come down from heaven and do all their work for them.