News for hackers. Stuff that matters.
Re:Programming languages should have a tree traversal primitive by charrondev on Tuesday April 29, 2025 @07:19PM (#43839213)
In what way is for different than an iterator?

In PHP you loop through an iterator with the foreach control structure.

In JavaScript you use for of.

In rust it’s for in.

What am I missing?

Re:Programming languages should have a tree traversal primitive by IshKebab on Wednesday April 30, 2025 @12:21PM (#43847399)
You're missing that I am an idiot and was mixing up iterators with functional style programming :D