
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
this is MQL
This is a MQL BUG!
https://www.mql5.com/en/docs/basis/namespace
we are not discussing c++,python,java,c# and so on here.. and i am not interested in programming language debate..this is MQL
MQL inserts all included libraries to the main file which is the source of many complexities and errors.
When something is wrong, it's wrong. I don't care best practices right now. The above codes can be simply rewritten to working codes which I'm doing for 2 years and wondering why MQL team won't fix these problems.
Now let's wrap up
MQL inserts all included libraries to the main file which is the source of many complexities and errors.
When something is wrong, it's wrong. I don't care best practices right now. The above codes can be simply rewritten to working codes which I'm doing for 2 years and wondering why MQL team leave these problems live till now.
The namespace implementation is definitely broken and doesn't work as described in the documentation. If you want to make use of globals in its currently broken state then I can confirm that you won't have any conflicts with the standard library if you define your global variables with a "g_" prefix. It's both a programming best practice and a practical fix for your specific errors.
The namespace implementation is definitely broken and doesn't work as described in the documentation. If you want to make use of globals in its currently broken state then I can confirm that you won't have any conflicts with the standard library if you name your global variables with a "g_" prefix. It's both a programming best practice and a practical fix for your specific errors.
Okay "g_" prefix?
I'm using a library that has functions with local variables prefixed with "g_" and I don't want to touch the library. Now should I add another "g_g_" to my global variables?
When something is wrong, it's always wrong.
Okay "g_" prefix?
I'm using a library that has functions with local variables prefixed with "g_" and I don't want to touch the library. Now should I add another "g_g_" to my global variables?
When something is wrong, it's always wrong.
Then use a class as a namespace. At least it will "work".
This is a MQL BUG!
https://www.mql5.com/en/docs/basis/namespace
take it easy...my understanding is this below regardless the namespace block, so long as it's put outside function description, it will be part of the global if the library is going to be included in the file where the namespace is set..but the global value of res will not affect the value of res inside the namespace block
i could be wrong but MQL guys can answer this precisely. I don't think it's a bug in my opinion, you could have your opinion but i am not interested to find who's right, we are all entitled to have different view
I don't think it's a bug in my opinion, you could have your opinion but i am not interested to find who's right, we are all entitled to have different view
I consider it a bug when the operation of a feature in practice performs inconsistently and contrary to its documentation.
The only way this (your code with namespace) is NOT a bug is if the MQL maintainers intended to have namespaces that don't respect scope and than also proceeded to incorrectly translate ru to en in the docs. In which case the docs should read something like, "the keyword 'namespace' is reserved for future implementation, but does not respect proper scope at this time."
The aforementioned scenario is so highly unlikely that I feel confident in my assumption that namespace is a bugged-feature.
I consider it a bug when the operation of a feature in practice performs inconsistently and contrary to its documentation.
The only way this (your code with namespace) is NOT a bug is if the MQL maintainers intended to have namespaces that don't respect scope and than also proceeded to incorrectly translate ru to en in the docs. In which case the docs should read something like, "the keyword 'namespace' is reserved for future implementation, but does not respect proper scope at this time."
The aforementioned scenario is so highly unlikely that I feel confident in my assumption that namespace is a bugged-feature.
Why do you bet? I won the bet.
A global variable shouldn't be accessed by an included file and that warning is because the compiler does a nasty thing in the first place. How should I explain this so everyone stop telling me ...?
I explained why this kind of name managing is not good for big projects.
I bet you never bother to understand what I'm talking about.
I bet every experienced compiler designer will agree with me.
>> Understand what I'm talking about then tell me "know your tool then your experiences count."
That's your assumption.
Refer to https://www.mql5.com/en/docs/basis/preprosessor/include and you'll read following:
" The preprocessor replaces the line #include <file_name> with the content of the file ..."
"#include" is a simple "text replacement".

As I said, know your tool not your "wish tool".