Re:My Weird Ruby
by masklinn on Saturday March 07, 2015 @05:18AM
(#9161510)
Javascript iteration primitive isn't block-based.
[ Parent
| on HN ]
Re:My Weird Ruby
by picks_at_nits on Saturday March 07, 2015 @06:55AM
(#9161638)
Ruby iteration primitive isn’t block based, either.
Of course it is. `for a in b` desugars to `b#each`, not the other way around.
Re:My Weird Ruby
by picks_at_nits on Saturday March 07, 2015 @07:33AM
(#9161694)
How do “while” and “until” desugar? Kernel#loop?
Re:My Weird Ruby
by chrisseaton on Saturday March 07, 2015 @10:39AM
(#9162008)
Those are two rare exceptions and you're right they don't desugar.
Re:My Weird Ruby
by picks_at_nits on Saturday March 07, 2015 @11:45AM
(#9162240)
Those 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.