Wishes for MT5 - page 70

 
MetaDriver:

To the compilers, a suggestion.

Please make transfer of small structures by value, not only by reference. Because all complex/rational arithmetic is terribly slow.

Please explain how passing by reference instead of structure value transmission can slow down? Best of all with an example.


As soon as we allow passing structures by value, the real braking begins. Developers will unknowingly use passing of huge structures through the stack everywhere and their programs will be slowed down.

 
MetaDriver:

Multiple inheritance is definitely evil.

Ы? How do you inherit two interfaces?

I'm all for merging with sharps rather than pluses. It makes a lot more sense there, given the generations of experience.

At least with basics. Such expressions are blatant trolling.
 
MetaDriver:

A request to compilers.

Please make transfer of small structures by value, not only by reference, because all complex/rational arithmetic is terribly slow.

Simply set a limit (at your discretion - 32 or 64 bytes) after which the compiler does not pass structure passed by value and strictly requires passing by reference.

Also would be very nice to be able to return small structures as a function result.

--

I even vote for operator overloading. I hope I will get around to it one day. It seems that the course "to merge with C++" is taken and generally supported.

Functional syntax for arithmetic operations with non-standard mathematical objects is very inconvenient, and also slows down a lot,

because it cannot be replaced by inline substitutions and requires the expenditure of function calls.

No. Structures by reference only. No exceptions. Give us some figures for the brakes so that we can estimate the scale of the catastrophe.

We used to have an option to return structures as a function result. Eventually we overrode this option due to ambiguity of implementation (our internal debugging). We decided that since structures are passed by reference, pass the resulting structure as a parameter.

Overloading of operators is possible. But not now.

 
Developers: please make OnTimer() work in indicators that are not attached to a chart.
 
Lizar:
Developers: please make OnTimer() work in indicators which are not attached to chart.
+1000
 
stringo:

1. no. structures only by reference. No exceptions. For brakes, give figures, so we can estimate the scale of disaster.

2. We used to have an option to return structures as a function result. Eventually we overrode this option due to ambiguity of implementation (our internal squabbles). We decided that since structures are passed by reference, pass the resulting structure as a parameter.

3. overloading of operators is possible. But not now.

1. :) Catastrophe is cancelled. I've measured it and was very surprised, the brakes are not in it (the script is in the trailer). I'll search myself and optimize. But syntax in many cases is more convenient, when you can substitute expressions in the parameters. Yeah. Well, I can live with this. It's bearable. The main thing is that it doesn't slow down.

2) Can we reassign structures back? Assignment of structures is perfectly legal, so let's allow it back too. The program is much more readable when the assignment of the function execution result is syntactically unified:

Y = Func(X); - it looks much clearer when reading the code briefly than Func(X, Y); // you should guess that Y is an out-parameter.

No, Straustrup would not like your solution... it's not right somehow... :)

3. Oh! That's good. Thank you for that.

Files:
 
MetaDriver:

Can we also reassign structures legally, so let's allow them to reassign too. The program is much more readable when assigning the result of a function is syntactically unified:

I'll tell you a secret. Just do it.

Turns out they didn't cut it off. You can return simple structures. But keep in mind that in this case you will have to add 2 extra copies - copying into the tempo structure on the stack and copying from the tempo structure into the result structure.

Документация по MQL5: Основы языка / Типы данных / Структуры и классы
Документация по MQL5: Основы языка / Типы данных / Структуры и классы
  • www.mql5.com
Основы языка / Типы данных / Структуры и классы - Документация по MQL5
 

Why is the CExpert class from the standard library declared as such in the Documentation,

class CExpert : public CObject

and in the Expert.mqh file we see this declaration?

class CExpert : public CExpertBase
Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
There is a need for an article on classes for creating and testing trading strategies...
 
Lizar:
Developers: please make OnTimer() work in indicators which are not attached to the chart.
At the moment it is unlikely. The function to set the timer should be called ChartSetTimer(), this name reflects its behavior more accurately.
Документация по MQL5: Работа с событиями / EventSetTimer
Документация по MQL5: Работа с событиями / EventSetTimer
  • www.mql5.com
Работа с событиями / EventSetTimer - Документация по MQL5