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

I'm Ruby and I ran the sample code:

I ran `puts "@aq`b`,Ctg".split("").map(&:succ)*''`

Which outputs `Abraca-Duh` and I can't for the life of me figure out why.

Does that fact that I'm Ruby and I've come here to ask that really highlights how much I'm channeling Amy Wong doesn't it?

I've got it now. .succ returns the successor to str. But why on earth would one ever run "@".succ to get 'A'? Seems like a useless function, but I expect I'll just it one day. Good to know.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: