Hacker News new | past | comments | ask | show | jobs | submit login

‘it’ is a welcome addition!





I don't understand the point of it when the `.map(&:upcase)` syntax is shorter. This just seems like yet another syntactic sugar Rubyism that doesn't really add anything.

If it's an alternative to the `|x|` syntax when using only one block variable, then I like that.


That only works when calling a method on the things you’re iterating thru, it is a replacement for the single variable block example you gave there

`arr.map { it.thing.blah.stuff }`

The `&:` doesn't work in that context


Not to point any fingers, but shows that the previous commenter have not struggled with this :)

&: is very nice, but not enough.


Does `it` conflict with Rspec's `it`? Surely they've thought of this, but to my eye it looks like it would get confusing.

Nope it doesn’t, they did take that into account during development.

Truly is, much nicer than that lonely `_1`

_2 can be as bad as _1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: