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

proc[arg1,arg2] is terrible; strictly worse than proc.call arg1, arg2. When I see an id followed by brackets, I'm looking at a collection, not a callable. This is only exacerbated by Ruby's weird/useful [index,length] convention.



I think what we both want is proc(arg1, arg2).


In newer versions of Ruby you can do proc.(arg1, arg2), which I think is a decent compromise.


Wow, I actually never knew that it was [index, length]. I usually just pass a range as the key when I'm doing stuff like that, so you can do "hello"[2..3] (2 <= i <= 3) or "hello"[2...3] (2 <= i < 3).




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

Search: