Only one wish: Source-Module and Binary-Module
To make Binary modules around the code before others inaccessible,
around this to selling or simply because one is ashamed of that

Imagine you have a game engine (for example), divided into several modules. Engine itself is a module, and modules engine - nested modules main module.freak wrote:Modules in modules:
I don't see a common need for this. I have a hard time coming up with a useful example for it to be honest. And the semantics of such a feature would be hard to define and understand. Once again: we are trying to keep things understandable and not make them unnecessarily complex.
For example, 3D function.freak wrote:What other feature should we have dropped to get the time for this?
Oh ... if you mean my quiping ... sorry if it was to much.freak wrote:Its not like we did nothing all these years. Look at the release history. What other feature should we have dropped to get the time for this?
Fred, the same stuff can be achieved with less complication, just look at the above post of mine.Fred wrote:As you seem interested by the module topic, here is our draft, so you can get a better idea. Please keep in mind than it's no promise, we can drop it if we change our mind so don't expect it for the next version.
Code: Select all
; Here is my suggestion: ...
Code: Select all
Crypto1.Cipher() ; call Cipher from module 1
Crypto2.Cipher() ; call Cipher from module 2
Code: Select all
Crypto1\\Cipher() ; call Cipher from module 1
Crypto2\\Cipher() ; call Cipher from module 2
Scenario: you include the source of module MOD in your main program, the module contains a Foo() procedure inside it (scope defined below).freak wrote:There is no confusion between an X_Foo() procedure that belongs to module X and another X_Foo() procedure that you write elsewhere because you can't. They refer to the same thing.
Yes, that would be simple and useful.fsw wrote:We have already IncludeFile and IncludeBinary why not add IncludeModule and make each file a module?
Code: Select all
;globally scoped function
Procedure Foo()
;...
EndProcedure
NameSpace Foo
state.i
procedure Foo()
;...
EndProcedure
EndNameSpace
UseNameSpace Foo
Foo()
;how to escape a namespace to the global namespace?
_foo() ; using underscore could break existing code
\foo() ; is just confusing
::foo() ;would work well
;or like like this which would be a hassle
UseNameSpace Main
foo()
CloseNameSpace
Be honest: The second one is the critical onets-soft wrote:[...] To make Binary modules around the code before others inaccessible,
around this to selling or simply because one is ashamed of that
The concept above would apply to all names. The procedures are just examples.User_Russian wrote: All constants, structures, procedures need to be isolated from the main program, and then the that suggest, can not be called isolation!
You can have the nested modules side by side. Just use descriptive names and there will be no problem. There is no need for them to be nested. I don't know a real world project that uses nested namespaces, even though other languages allow it. People avoid this because it makes things more complex, not less.User_Russian wrote:Imagine you have a game engine (for example), divided into several modules. Engine itself is a module, and modules engine - nested modules main module.
That is just your opinion. If i ask somebody else he would mention your most favorite feature. Would you be ok if we had postponed that?User_Russian wrote:freak wrote:
What other feature should we have dropped to get the time for this?
For example, 3D function.
It was aimed at the general "why did feature X take so many years?" questions. Its not feature X that took so long. The tons of other features combined did.PMV wrote:Oh ... if you mean my quiping ... sorry if it was to much.freak wrote:Its not like we did nothing all these years. Look at the release history. What other feature should we have dropped to get the time for this?
You get an "already defined" error because you can see the one in the module and try to define something with the same name.luis wrote: 1B) Foo() in the module is External
You try do define a Foo() proc in the main program. What happens ? Error ? (you now can access Foo() in the module simply through its name right ?)
Code: Select all
Module GUI
External Procedure Foo()
EndProcedure
EndModule
Procedure Foo()
EndProcedure
OpenModule GUI As Blub
BLub_Foo()
Foo()
CloseModule
No an underscore makes no sense.idle wrote:it makes perfect sense to use an underscore
Code: Select all
Module main
IncludeModule "myFoo" ; has a Foo() procedure
Procedure Foo()
;...
EndProcedure
Foo() ; this is the local Foo
myFoo\\Foo() ; this is the Foo from module myFoo
Code: Select all
Module main
IncludeModule "myFoo" ; has a Foo() procedure
Foo() ; this is the Foo from module myFoo
By 'names' you mean constants and structures would be isolated too?freak wrote:The concept above would apply to all names. The procedures are just examples.User_Russian wrote: All constants, structures, procedures need to be isolated from the main program, and then the that suggest, can not be called isolation!
Yes.skywalk wrote:By 'names' you mean constants and structures would be isolated too?freak wrote:The concept above would apply to all names. The procedures are just examples.User_Russian wrote: All constants, structures, procedures need to be isolated from the main program, and then the that suggest, can not be called isolation!
With that the underscore makes much more sense as everything else. But ifreak wrote:The concept above would apply to all names. The procedures are just examples.