4 ms·
Ruby iteration primitive isn’t block based, either.
by picks_at_nits 12y ago
Ruby iteration primitive isn’t block based, either.
- masklinn 12y agoOf course it is. `for a in b` desugars to `b#each`, not the other way around.
- picks_at_nits 12y agoHow do “while” and “until” desugar? Kernel#loop?
- chrisseaton 12y agoThose are two rare exceptions and you're right they don't desugar.
- picks_at_nits 12y agoThose are not “exceptions” to Ruby’s primitives, those are Ruby’s primitives. Things that desugar to methods aren’t primitives. The thing is, they’re rare in practice for cultural reasons.