Discussion of article "MQL5 Programming Basics: Lists"

 

New article MQL5 Programming Basics: Lists has been published:

The new version of the MQL language has provided developers of automated trading systems with effective tools for the implementation of complex tasks. One cannot deny the fact that the programming functionalities of the language have been considerably expanded. The MQL5 OOP features alone are worth a lot. Furthermore, the Standard Library should not go unmentioned. Judging by the error code number 359, class templates will be supported soon.

In this article, I would like to bring up what may in some way be an expansion or continuation of the subjects describing data types and their sets. Here, I would like to make reference to an article published on the MQL5.community website. A very detailed comprehensive description of the principles and logic of working with arrays was provided by Dmitry Fedoseev (Integer) in his article "MQL5 Programming Basics: Arrays".

So, today I propose to turn to lists, and more precisely, to linked linear lists. We will start with list structure, meaning and logic. After that, we will consider the related tools already available in the Standard Library. In conclusion, I'll provide examples of how lists can be used when working with MQL5.

Fig. 1 Nodes in a singly linked list
Fig. 1 Nodes in a singly linked list

Author: Dennis Kirichenko

 
Its a good article and I think it was written to every one in Mql5 community because every thing is clearly explained.
 
I must say this article gives a clear insight about OOP I am moved by how after I read this I gained a lot ,I take a bow
 

Hello,

I try to compile test_MQL5_List.mq5 , I got the following errors :

'm_head' - member of the constant object cannot be modified CiSingleList.mqh 504 9
'm_tail' - member of the constant object cannot be modified CiSingleList.mqh 505 9
'm_size' - member of the constant object cannot be modified CiSingleList.mqh 496 9


 

Here's the repaired code. Please replace the older version.

The mistake was in declaring some methods as constant, whereas they are not.

Files:
files.zip  25 kb
 
Dennis Kirichenko:

Here's the repaired code. Please replace the older version.

The mistake was in declaring some methods as constant, whereas they are not.


No more errors.
Thanks Dennis.

Reason: