Modules vs Packages

Daniel Keep daniel.keep.lists at gmail.com
Sat Sep 8 19:39:22 PDT 2007


Kirk McDonald wrote:
> [snip]
>
> The reasons given for the api.py convention in the link above do not
> generally apply to D. Something equivalent to __init__.py would be
> sufficient. I suggest "this.d". Being a keyword, 'this' cannot be used
> as a regular module name. It also evokes existing D syntax (and, indeed,
> is like Python using __init__, which is the name Python uses for class
> constructors).

Oh, I *like* that solution.  I don't suppose it's a coincidence that
"this" in Python is "__init__"? :P

> It's worth pointing out (again) that D's import, module, and package
> semantics are a lot like Python's. It has already shamelessly stolen
> selective, static, and renaming imports from Python, and so it should go
> whole hog and get this in there, as well.

While we're at it, maybe we could get relative imports, too... :)

	-- Daniel



More information about the Digitalmars-d mailing list