Our great sponsors
Package iter provides generic, lazy iterators, functions for producing them from primitive types, as well as functions and methods for transforming and consuming them. (by mtoohey31)
The reason why I decided on the inner/outer architecture was because interface objects can't be used as recievers to methods (as far as I understand). As a result, my initial implementation, which didn't have this structure, was limited to functions instead of methods, which made code where iterator methods were chained extremely unreadable, since it was difficult to tell which order they were being applied in. It's a tradeoff, but I think the readability might be worth it. Do you have any ideas for alternative workarounds?
The Go programming language
Also, can anyone explain the error "instantiation cycle" to me? I have two methods commented for which this was occuring: Position in iter.go, and ZipEndo in zip.go, and I'm not sure what this error means, or why it occurs, since the corresponding function implementation (Zip) of ZipEndo has no such problem. I don't believe it's an implementation bug in the tuple package, since I was originally using my own simple 2-value tuple struct and the exact same error ocurred. The only thing I can find about it online is this post, but I'm not sure how the answer there applies to either of my cases...
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Generic tools for go 1.18+
Looks good Do you benchmark it vs for loop? Recently I am wrote pretty similar lib but using functions for all(filter, ForEach etc): gtools Maybe you will find something for yours lib
Go 1.18 generics iterator experiment
Regarding call chaining, it is still possible to chain things with operations that return different types, but they have to be done with functions instead of methods, so the result is still the same, just it's a little less readable. There is a generic iterator implementation by polyfloyd that doesn't support method chaining, but imo being able to chain iterators is one of their biggest strengths, since implementing lazy evaluation manually for a single operation isn't that difficult, its when you need to perform multiple kinds of manipulations that it gets messy.
A collection of experiments using Go Generics coming out in Go 1.18
I did some experimenting of my own and came up with this design: https://github.com/qualidafial/go-generic/tree/master/iter
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Is a project based approach to learning things good ?
1 project | reddit.com/r/developersIndia | 27 Mar 2023
Immutable references in Go?
2 projects | reddit.com/r/golang | 26 Mar 2023
My believe that Golang will grow in demand and how maybe this is ruining my pay increase
1 project | reddit.com/r/golang | 25 Mar 2023
Go issue: stop using direct syscalls on OpenBSD
1 project | news.ycombinator.com | 24 Mar 2023
Planning Go 1.21 Cryptography Work
2 projects | reddit.com/r/golang | 24 Mar 2023