Is D really that bad?

rikki cattermole rikki at cattermole.co.nz
Sun Nov 6 03:14:06 UTC 2022


On 06/11/2022 2:56 PM, Walter Bright wrote:
> Using the module as the fundamental unit of encapsulation and making it 
> a 1:1 correspondence with files is a good fit for modern filesystems. 
> (Old filesystems were so slow most people would try to cram a program 
> into a small number of files.)

We do have this handy dandy little assumption in our design however:

``foo\bar.d(1): Error: package name 'foo' conflicts with usage as a 
module name in file foo.d``

```
.
├── entry.d
├── foo
│   └── bar.d
└── foo.d
```

It does mean we can place multiple modules in a file as long as only one 
of them is the root.

```d
module root;

module root.foo {

}
```



More information about the Digitalmars-d mailing list