<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div apple-content-edited="true" class=""><div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On 20 Dec 2014, at 06:54, Dmitri Zimine <<a href="mailto:dzimine@stackstorm.com" class="">dzimine@stackstorm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I appended some more ideas on making for-each loop more readable / less confusing in the document. </div><div class=""><br class=""></div><div class="">It’s not rocking the boat (yet) - all the key agreements done that far, stay so far. It’s refinements. </div><div class=""><br class=""></div><div class="">Please take a look, leave comments, +1 / -1 for various ideas, and leave your ideas there, too. </div><div class=""><br class=""></div><a href="https://docs.google.com/document/d/1iw0OgQcU0LV_i3Lnbax9NqAJ397zSYA3PMvl6F_uqm0/edit#heading=h.5hjdjqxsgfle" class="">https://docs.google.com/document/d/1iw0OgQcU0LV_i3Lnbax9NqAJ397zSYA3PMvl6F_uqm0/edit#heading=h.5hjdjqxsgfle</a></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">Dmitri, thanks. Looks like you guys have been really creative around this blueprint :)</div><div class=""><br class=""></div><div class="">I left my comments in the document. In essence, I would suggest we stop at the following syntax:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">1. Short one-line syntax in case we need to iterate through one array.</div><div class=""><br class=""></div><div class="">    task1:</div><div class="">        for: my_item in $.my_array</div><div class="">        action: my_action ….</div><div class=""><br class=""></div><div class="">2. Full syntax in case there are more than one array that we need to iterate through.</div><div class=""><br class=""></div><div class=""><div class="">    task1:</div><div class="">        for:</div><div class="">            my_item1: $.my_array1</div><div class="">            my_item2: $.my_array2</div><div class="">            ...</div><div class="">        action: my_action ….</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Option 3</div><div class=""><br class=""></div><div class=""><div class="">    task1:</div><div class="">        for:</div><div class="">            - my_item1 in $.my_array1</div><div class="">            - my_item2 in $.my_array2</div></div><div class=""><br class=""></div><div class="">also looks ok to me but it doesn’t seem a YAML way a little bit because in YAML we can express key-value pairs naturally like in #2. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Actually, I don’t see any problems with supporting all three options.</div><div class=""><br class=""></div><div class="">As far as naming, let’s comment on each of the options we have now:</div><div class=""><ul class="MailOutline"><li class="">‘‘for-each’ - I’d be ok with it but seems like lots of people have been confused with it so far because their expectation were really different than the description we told them, so I’m ok to pick a different name.</li><li class="">“map” - I’m totally against it, first glance at “map” would make very little sense to me even though I understand where this option comes from. I’m pretty sure it will be even more confusing than “for-each”.</li><li class="">“with_items” -  Ansible style, it’s ok to me.</li><li class="">“for” - I think this is my favourite option so far. Semantically it may not be too different than “for-each” but it’s very concise and most general purpose languages have the same construct with similar semantics.</li></ul><div class=""><br class=""></div></div><div class="">After all, my suggestion would be not to spend huge amount of time arguing on naming. Although it’s pretty important, it’s always subjective to a great extent.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class=""><div class="">Renat Akhmerov</div><div class="">@ Mirantis Inc.</div></div><div class=""><br class=""></div></body></html>