Hacker News new | ask | show | jobs
by pekk 3433 days ago
What real difference does it make whether repeat is a method on integer objects or whether it takes an integer argument?
1 comments

Because a method on an integer object would mean it works in the same way as all library and application code; and therefore can be used as-is, or avoided by those who don't want it, or replaced if something better comes along.

Having "for" not be a method on an object means it's something completely different: a magical keyword control structure, a gift from the irreproachable language designers to the lowly language users; since mere users cannot be trusted to make such decisions for themselves.