Why is D unpopular

user1234 user1234 at 12.de
Mon Jun 13 09:12:47 UTC 2022


On Monday, 13 June 2022 at 09:09:08 UTC, user1234 wrote:
> On Monday, 13 June 2022 at 08:13:14 UTC, claptrap wrote:
>> On Sunday, 12 June 2022 at 14:05:00 UTC, Max Samukha wrote:
>>> On Sunday, 12 June 2022 at 11:47:53 UTC, Mike Parker wrote:
>>>
>>>> Hi. My name's Mike. Nice to meet you.
>>>
>>> Hi, Mike! Congratulations on being the first unsurprised D 
>>> user! (You were actually surprised for a moment, weren't you?)
>>
>> Anyone who used Object Pascal / Delphi wouldn't have been 
>> surprised either.
>
> True but ObjFPC has `strict private` too since a while: [demo].
> This does exactly what is discussed on the D forum since a week.
>
> [demo]: https://ideone.com/j0kCMD

well the online compilers are too old, but if you try this code 
with a more recent compiler

```pascal
{$MODE OBJFPC}{$H+}
{$MODESWITCH ADVANCEDRECORDS}
type TS = record
   private
     a: integer;
   strict private
     b: integer;
end;

var
  s: TS;

begin
   s.a := 1; // OK
   s.b := 1; // NG
end.
```

this gives

> project1.lpr(15,5) Error: identifier idents no member "b"


More information about the Digitalmars-d mailing list