Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought this would be a fun exercise, so I implemented the Go equivalent. Can anyone get it to fewer lines? It abandoned all pretenses of readability long ago.

http://play.golang.org/p/M5VaeIgQ-q



Updated to generalise a bit more. If this ever came up in code review, I'd probably facepalm pretty hard.

http://play.golang.org/p/YUQSZgFx_b


Ha. Yeah, the map() and reject() function defs are fine but the actual usage is a little eye-bleed inducing :)


So now that we've established Ruby is better at being Ruby than Go is, I wonder if there's an actual use case for this kind of thing, so I can demonstrate the "Go way" of handling it...




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

Search: