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

You can always implement a FooReader, which iterates over a flow of Foo objects (which might, for example, be items in a slice or channel). We do this all the time. It is, as you note, quite simple and I think elegant too.


Yes, I have done this, but I was talking more about streams that I can splice, filter, map, join, pair, slice, window, buffer, groupby, scan, skip, take, switch, zip, reduce, etc.

Not really possible without generics, lambdas and a good core of functional routines.

Once you get used to this and the speed, productivity and elegance with which problems can be solved, using Golang feels a bit primitive and painful. The same Go code is usually 5x-10x longer.




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

Search: