Thank you, that solved the problem. On Wednesday, March 13, 2024 at 1:22:06 PM UTC Sebastien Binet wrote:
> hi Mark, > > On Wed Mar 13, 2024 at 13:32 CET, 'Mark' via golang-nuts wrote: > > I've been trying to learn how to create an `All() iter.Seq[T]` method > > for a > > simple set type (a map wrapper): > > > > playground <https://go.dev/play/p/wtWvvTf33AF?v=gotip> > > > > It won't work in the playground of course, but when I do: > > `GOEXPERIMENT=rangefunc go run .` > > using Go 1.22 I get this error: > > ``` > > cannot use func(yield func(int, T) bool) {…} (value of type func(yield > > func(int, T) bool)) as iter.Seq[T] value in return statement > > ``` > > Can someone help me get this right please? > > IIRC, > > ``` > return func(yield func(int, T) bool) { ... } > ``` > is for iter.Seq2[int,T] > > if you want iter.Seq[T] you should write: > > ``` > return func (yield func(T) bool) { ... } > ``` > (and adapt accordingly) > > hth, > -s > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/063c64c8-ebfe-4039-abce-4b405e74d3e8n%40googlegroups.com.