digitalmars.D - private with module name support
- Newbie2019 (20/20) Aug 08 2019 When init a projects, or design encapsulation type. It is
- Newbie2019 (7/8) Aug 08 2019 The app init function basic only call once, and call from the app
- 12345swordy (3/11) Aug 08 2019 Are you trying to implement the functionality as if it were C?
- Newbie2019 (6/8) Aug 08 2019 di file will not solve the problem, and in most case the public
When init a projects, or design encapsulation type. It is frequently feed need to made some target only accept by one special module(not package but only module). With current solution, I has to use package(Player) , this is not perfect because people can modify package name to made the resource accessible. This is also not work well for a package.d module(not able to access from same folder). the code look like this: ======================= module PlayerImplement; private(Player) void doSomeThing(){ } ======================= module Player; import PlayerImplement; void doKill(){ doSomeThing(); } ======================= Is this make any sense ?
Aug 08 2019
On Friday, 9 August 2019 at 01:17:28 UTC, Newbie2019 wrote:Is this make any sense ?The app init function basic only call once, and call from the app entry pointer, do so can avoid other module unexpected call component init function(right now I guard it with a global inited var). I know class inheritance also can do the trick, but class has extra cost so not suit for simple case.
Aug 08 2019
On Friday, 9 August 2019 at 01:24:30 UTC, Newbie2019 wrote:On Friday, 9 August 2019 at 01:17:28 UTC, Newbie2019 wrote:Are you trying to implement the functionality as if it were C? Look into .di files.Is this make any sense ?The app init function basic only call once, and call from the app entry pointer, do so can avoid other module unexpected call component init function(right now I guard it with a global inited var). I know class inheritance also can do the trick, but class has extra cost so not suit for simple case.
Aug 08 2019
On Friday, 9 August 2019 at 01:40:01 UTC, 12345swordy wrote:Are you trying to implement the functionality as if it were C? Look into .di files.di file will not solve the problem, and in most case the public interface(or api) and implement part in same package, use di make no sense. This new feature allow to split complex source code from one file into multi, without losing the type protection from outside.
Aug 08 2019