p0nce / binrange

Utility functions to parse/emit on a range of bytes.
The Unlicense
3 stars 1 forks source link

Module name question #4

Closed o3o closed 9 years ago

o3o commented 9 years ago

Hi, I 've seen that you've changed the your module name to package.d

But package is standard name that provides a way to import a package. Maybe old name is better...what do you think?

p0nce commented 9 years ago

Explain why it would be better. It does'nt change the user code.

import binrange;
o3o commented 9 years ago

Hi Guillaume It's not so important, just a convention.

First, from http://dlang.org/module.html:

Modules have a one-to-one correspondence with source files. The module name is, by default, the file name with the path and extension stripped off, and can be set explicitly with the module declaration.

and from http://ddili.org/ders/d.en/modules.html

By default, the name of a module is the same as its filename without the .d extension.

Then , our case module binrange; => file binrange.d

Second, package.d is a conventional module name for importing all modules in a package.

from http://ddili.org/ders/d.en/modules.html

... It is achieved by a special configuration file in the package directory, which must always be named as package.d.

and from http://dlang.org/module.html#package-module

A package module can be used to publicly import other modules, while enabling a simpler import syntax..... The package module must have the file name package.d.

Thank for your attention.

p0nce commented 9 years ago

Indeed it didn't make much sense, I've renamed it.

Use the v1.0.2+ tag

o3o commented 9 years ago

Hi Guillaume, Why in your opinion package. convention does not make sense? It's very common:

which convention do you use ?

BAT

p0nce commented 9 years ago

Of course it makes sense, I was talking about the previous naming. package.d is not only a convention, the compiler recognize it.

o3o commented 9 years ago

Ops...my English is really poor :)

Thank again, specially for your d-idioms... it's awesome

BAT

p0nce commented 9 years ago

Thanks:) np