On Thursday, 29 September 2016 at 01:54:42 UTC, Minty Fresh wrote:
module leastsq;
Here's my tip: always give a module a name with at least two
pieces, and always write it explicitly.
So make it `module your_name.leastsq;`.
If you ever end up mixing modules from different projects, this
On 29.09.2016 06:17, Minty Fresh wrote:
Going with the example I gave, what would an alternative name for the
module be? All it's public members are named `leastsq`.
I usually just add an underscore to the module name. module leastsq_;
On Thursday, 29 September 2016 at 04:17:56 UTC, Minty Fresh wrote:
On Thursday, 29 September 2016 at 02:26:15 UTC, Joakim wrote:
I ran into this too, it is annoying. I think you're supposed
to use different names.
It's a rather painful limitation if that were the case.
Going with the example
On 2016-09-29 04:26, Joakim wrote:
I ran into this too, it is annoying. I think you're supposed to use
different names.
Yeah, especially since I have a lot of module looking like this:
module main;
void main()
{
// some stuff
}
This works since "main" is a special function which is
On 9/28/2016 9:17 PM, Minty Fresh wrote:
While I can imagine there are technical challenges that have caused this issue
to be the way it is, it's still a pretty major flaw to try to work around.
Overloading of names is a constant minefield of unexpected problems, arbitrary
rules to
On Thursday, 29 September 2016 at 02:26:15 UTC, Joakim wrote:
I ran into this too, it is annoying. I think you're supposed to
use different names.
It's a rather painful limitation if that were the case.
Going with the example I gave, what would an alternative name for
the module be? All it's
On Thursday, 29 September 2016 at 01:54:42 UTC, Minty Fresh wrote:
I ran into this issue just recently when trying to write a
least-squares optimization function.
Notably,
module leastsq;
T[] leastsq(alias func, T)(T[] vec, . . .)
{
. . .
}
It becomes impossible to import and
As an addendum to the above, the error message I posted was from
the overload that takes a delegate as a runtime parameter.
Trying to pass template arguments just gives you:
Error: template instance leastsq!((p) => p) leastsq is not a
template declaration, it is a import
I ran into this issue just recently when trying to write a
least-squares optimization function.
Notably,
module leastsq;
T[] leastsq(alias func, T)(T[] vec, . . .)
{
. . .
}
It becomes impossible to import and call this template function
from outside the module it's declared