Re: "Error: function expected before (), not module *module* of type void

2018-09-22 Thread ag0aep6g via Digitalmars-d-learn
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

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Samir via Digitalmars-d-learn
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() {

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Adam D. Ruppe via Digitalmars-d-learn
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

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Samir via Digitalmars-d-learn
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