Coming from the Ruby world, I instantly understood why Crystal chose not to implement a for
method. But then I was surprised to see that Crystal does implement a for
method for macros. I was even more surprised to find that macros don't allow an enumerable (.each
, etc) syntax (i.e. {% ["one", "two", "three"].each do |value| %}
isn't valid macro syntax).
Is there a logical reason for this syntax difference? It's possible that the answer is simply ~"because the devs decided that macro syntax looks like x, and non-macro syntax looks like y", but I'm guessing that there is more to it then that (an arbitrary syntax inconsistency seems like a flaw).
Thanks!