|
|
|
|
|
by alexfrydl
1681 days ago
|
|
Ruby's “for … in” is syntax sugar in the sense that is just another way to spell an identical piece of code. This would be like if Python let you write “foreach” instead of “for” if you wanted to. Another example in Ruby is how you can say “unless” instead of “if not”. Python's “for … in” is syntax sugar in the sense that is an abstraction over constantly writing out the iterator protocol. |
|