stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 223 forks source link

Iterating arrays with their indexes and values #170

Closed ilyapuchka closed 6 years ago

ilyapuchka commented 6 years ago

This allows to enumerate arrays by their indexes and values, not just by their values, instead of using forloop context variable.

kylef commented 6 years ago

Rebased this on master, this is breaking the behaviour of iterating over tuples. We will have to rethink how to implement this one.

ilyapuchka commented 6 years ago

@kylef as we have counters now I think we can close this

ilyapuchka commented 6 years ago

Probably we should introduce another way to unpack tuples, not sure if using for-loop for that is good. Then we will be able to use this feature. But it will be a breaking change.