On 09/22/2018 04:51 AM, Samir wrote:
Thanks for your help, Adam! Right after posting my question, I started
reading this site:
https://www.tutorialspoint.com/d_programming/d_programming_modules.htm
Better read the original:
http://ddili.org/ders/d.en/modules.html
On Saturday, 22 September 2018 at 01:58:57 UTC, Adam D. Ruppe
wrote:
You probably shouldn't name a module the same as a member
anyway, and it should also have two names, like "module
myproject.isprime;"
But the fix here is to just use the full name.
import isPrime;
void main() {
On Saturday, 22 September 2018 at 01:51:33 UTC, Samir wrote:
main.d:
import isPrime;
void main() {
isPrime(x);
}
You probably shouldn't name a module the same as a member anyway,
and it should also have two names, like "module
myproject.isprime;"
But the fix here is to just use the
files are in the same directory. When compiling main.d, I
get:
Error: function expected before (), not module isPrime of type
void
I've tried changing the name of the function isPrime in isPrime.d
to something else (as well as changing the name in the main
program) but then I get an error