I have a doubt respect the use of cycles structures differents to while and for loop
What do you understand or find about that problem
I know that now we have to avoid use while and for loops however there are structures that have a similar behaviour for example in Lisp, which is language that I using now, we have cycles structures as (dolist (x var)) this sturctures have exactly the same apparent behaviour that “for x in var” from python for example, both following codes make exactly same thing.
//Python. fruits = ["apple", "banana", "cherry"] for x in fruits: print (x) //LISP (setq fruits (list "apple" "banana" "cherry")) (dolist (x fruits) (print x))
Then, could I use that structure (dolist) since itsn’t a for or while loop?, or on the contrary I should avoid due that x object is changing as in a for loop.
You make any workaround? What did you do?
In this moment I’m sure that I could totally avoid the use of cycles structures however when I need to replace a nested loop I have to send counters to the functions for going through nested list.