string object won't compile

psychoticRabbit meagain at meagain.com
Tue Mar 6 00:18:14 UTC 2018


On Monday, 5 March 2018 at 23:34:50 UTC, askjfbd wrote:
> Someone please tell me how, for I am a newbie and don't know 
> any solutions even to this very simple problem. As I learned 
> dlang using the Dlang tour page, I stuck at the alias & Strings 
> page. I have tried to compile the following simple code many 
> times but still get the same error both from dmd and gdc. They 
> both say that...

This is mistake I made too, when i began using D.

I quickly got into the habit of putting

module test;

at the beginning of every file I create, unless I determine a 
better module name.

Actually, I wrote my own IDE, so it does that for me whenever I 
select a new D file.

Personally, I think that is one of the first things newcomers 
need to learn about - modules.

-------------
"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."

"Modules automatically provide a namespace scope for their 
contents."

https://dlang.org/spec/module.html

------------


More information about the Digitalmars-d-learn mailing list