module and function names

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jan 2 13:15:47 PST 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.


More information about the Digitalmars-d-learn mailing list