May 16, 2018
On Wednesday, 16 May 2018 at 13:09:22 UTC, Jesse Phillips wrote:
> That isn't a bug. What is the software use case? How did this case differ because someone did this?
>

Sorry, I didn't realise my example was so complex.

Hang on... I'll just put it all into a use case diagram in my new UML tool... I'll get back to you on this.... soon...


May 16, 2018
On 05/16/2018 04:42 AM, Dave Jones wrote:
> On Wednesday, 16 May 2018 at 08:20:23 UTC, Uknown wrote:
>> On Wednesday, 16 May 2018 at 07:53:36 UTC, aliak wrote:
>>
>> Just checked the rust spec [0]. private in rust => accessible from that module and its descendants, which is what package in D is. private in D would be to that module only.
>>
>> [0]: https://doc.rust-lang.org/beta/reference/visibility-and-privacy.html
> 
> Dont know if its been mentioned before but in Delphi / Object Pascal private is accessible to everything in the same module. Same as D.

This is interesting, thanks for the info.
May 16, 2018
On 05/16/2018 04:28 AM, meppl wrote:
> a pitfall-section about 'private' and 'protected' in https://dlang.org/spec/class.html wouldnt hurt.

Yah, improvements to the spec are always welcome and not difficult to effect. It's one of the areas in which crowdsourcing would work nicely.

May 16, 2018
On Wednesday, 16 May 2018 at 13:33:45 UTC, KingJoffrey wrote:
> On Wednesday, 16 May 2018 at 13:09:22 UTC, Jesse Phillips wrote:
>> That isn't a bug. What is the software use case? How did this case differ because someone did this?
>>
>
> Sorry, I didn't realise my example was so complex.
>
> Hang on... I'll just put it all into a use case diagram in my new UML tool... I'll get back to you on this.... soon...

No I don't want that, and don't ever show me one.

Your example wasn't complex it just didn't describe a bug.

A use case should be simple. "list folder content." "make computer speaker beep." "print hello"

Even hobby programs have use cases. What was the program doing and how did it not meet those expectations.
May 16, 2018
On Tuesday, 15 May 2018 at 21:05:10 UTC, Jonathan M Davis wrote:

> Ultimately, if newcomers don't want to be tripped up on stuff like this, their best bet is probably to read books like Andrei's "The D Programming Language" and Ali's "Programming in D."

The wiki has a section dedicated to discussion of these matters for newcomers from other languages.
https://wiki.dlang.org/Coming_From#Specific_Language

I don't know how many newcomers are aware of that information, but that's really the place for it.
May 16, 2018
On 5/16/2018 6:55 AM, Andrei Alexandrescu wrote:
> On 05/16/2018 04:42 AM, Dave Jones wrote:
>> On Wednesday, 16 May 2018 at 08:20:23 UTC, Uknown wrote:
>>> On Wednesday, 16 May 2018 at 07:53:36 UTC, aliak wrote:
>>>
>>> Just checked the rust spec [0]. private in rust => accessible from that module and its descendants, which is what package in D is. private in D would be to that module only.
>>>
>>> [0]: https://doc.rust-lang.org/beta/reference/visibility-and-privacy.html
>>
>> Dont know if its been mentioned before but in Delphi / Object Pascal private is accessible to everything in the same module. Same as D.
> 
> This is interesting, thanks for the info.

I had no idea. It's either parallel gestation of a great idea, or they took it from D!
May 16, 2018
On Wednesday, 16 May 2018 at 16:43:31 UTC, Walter Bright wrote:
> On 5/16/2018 6:55 AM, Andrei Alexandrescu wrote:
>> On 05/16/2018 04:42 AM, Dave Jones wrote:
>>> On Wednesday, 16 May 2018 at 08:20:23 UTC, Uknown wrote:
>>>> On Wednesday, 16 May 2018 at 07:53:36 UTC, aliak wrote:
>>>>
>>>> Just checked the rust spec [0]. private in rust => accessible from that module and its descendants, which is what package in D is. private in D would be to that module only.
>>>>
>>>> [0]: https://doc.rust-lang.org/beta/reference/visibility-and-privacy.html
>>>
>>> Dont know if its been mentioned before but in Delphi / Object Pascal private is accessible to everything in the same module. Same as D.
>> 
>> This is interesting, thanks for the info.
>
> I had no idea. It's either parallel gestation of a great idea, or they took it from D!

Pascal has the same visibility attributes with the same semantics since Turbo Pascal 5.5 (1989). The only addition was 'published' attribute in 1995, somehow equivalent to 'export' in D.

And a vintage nostalgic ad :)
http://edn.embarcadero.com/article/images/20803/tp55ad.jpg
May 16, 2018
On Wednesday, 16 May 2018 at 16:43:31 UTC, Walter Bright wrote:
> On 5/16/2018 6:55 AM, Andrei Alexandrescu wrote:
>> On 05/16/2018 04:42 AM, Dave Jones wrote:
>>> On Wednesday, 16 May 2018 at 08:20:23 UTC, Uknown wrote:
>>>> On Wednesday, 16 May 2018 at 07:53:36 UTC, aliak wrote:
>>>>
>>>> Just checked the rust spec [0]. private in rust => accessible from that module and its descendants, which is what package in D is. private in D would be to that module only.
>>>>
>>>> [0]: https://doc.rust-lang.org/beta/reference/visibility-and-privacy.html
>>>
>>> Dont know if its been mentioned before but in Delphi / Object Pascal private is accessible to everything in the same module. Same as D.
>> 
>> This is interesting, thanks for the info.
>
> I had no idea. It's either parallel gestation of a great idea, or they took it from D!

Not sure of the exact timing but we're talking at least 17 years ago i think.
May 17, 2018
On Wednesday, 16 May 2018 at 16:43:31 UTC, Walter Bright wrote:
>
> I had no idea. It's either parallel gestation of a great idea, or they took it from D!

the splitting of the atom was a great idea too..now the world is on the brink of destruction (according to some).

how about adding a 'private' attribute on the class, which would mean, private inside the class is only accessible inside the class.

I presume the private attribute on the class, is not currently valid in D?

This seems unlikely to break anything, while giving the programmer back the control to strategically define interfaces that *must* be used.

My neighbour likes to back his car into his driveway.
To do so, he drives over my lawn in turns into his driveway.
Why? Because he doesn't respect the interface! (his driveway, is his interface, but cause I have no barrier around my lawn, he can do what he likes).

Yeah, i know, one class per module might solve this, sure...(put a fence around your lawn approach - but I like it without a fence.).

I really do prefer the 'program to interfaces' approach, and, occasionally I would like to have more than one class in the same module (where I deem that appropriate), and still have their interfaces respected.

I cannot do this in D.

Is there no way this can be accomodated in D (without breaking how things currently work)?

May 17, 2018
On Thursday, 17 May 2018 at 01:36:47 UTC, KingJoffrey wrote:
>
> how about adding a 'private' attribute on the class, which would mean, private inside the class is only accessible inside the class.
>
> I presume the private attribute on the class, is not currently valid in D?
>

or even 'sealed' (as in the actual meaning of the word)
6 7 8 9 10 11 12 13 14 15 16
Next ›   Last »