Adding Modules to C in 10 Lines of Code

forkit forkit at gmail.com
Mon Jun 6 03:17:34 UTC 2022


On Monday, 6 June 2022 at 00:19:16 UTC, zjh wrote:
> On Sunday, 5 June 2022 at 22:41:41 UTC, Walter Bright wrote:
>
>> Because it's fun to be first!
>
> Yes, `'d'` is always independent.
> For example, `'d'` is the `first one` without `class 
> encapsulation`.

To be fair, the encapsulation of a class can be encapsulated 
within a module, but not in a class (as one might reasonably 
expect, if they come from any other main stream language that 
uses a class type).

This implies (to me at least) that D does not consider a class to 
be a real type, like other main stream languages do.

Some new languages have even gone out of there way to get rid of 
the class type completely! At least D hasn't gone that far.. yet. 
I suspect there are many in the D community that would welcome 
that ;-)

Even an int type gets better recognition 'as a type', in D.

But yes, as far as i know, D is the first to do this - i.e. turn 
the class into a pseudo type, that cannot have encapsulation 
unless it is put into a super type (the module), all by its self 
(with no friends).

@private could change that.

D could be the first indeed, for turning a pseudo class type, 
back into an first class type.

C'mon D. Be the first!


More information about the Digitalmars-d-announce mailing list