On Sun, Nov 7, 2021 at 7:23 PM Kamil Ziemian wrote:
> Can anyone give me explicit example when semicolon is omitted in accordance
> to the second rule and explanation where it should be? I probably see such
> situations dozens of times, I just not know that they would needed semicolon
> in som
Hello,
I go back to reading Go spec and I read about omitting semicolon in Go
code. I know from some Rob Pike talks on YT or similar source, that
compiler inserts semicolon in "places where C programmer would expected it
to write". And since I try to follow Go style of writing code (Emacs also
* Axel Wagner:
> One way to fix this is to change the signatures to
>
> func Contains[I Iterator[T], T comparable](c I, value T) bool
> func Contains2[I Iterator[T], T comparable](value T, c I) bool
I had not realized that, thanks. The opposite order is perhaps more
useful, [T comparable, I Itera
One way to fix this is to change the signatures to
func Contains[I Iterator[T], T comparable](c I, value T) bool
func Contains2[I Iterator[T], T comparable](value T, c I) bool
Though I tend to agree that it would be preferable for this inference to
work.
On Sun, Nov 7, 2021 at 11:52 AM Florian W
I've tried this example, related to the collections example in the
proposal.
package main
type Iterator[T any] interface{
Next() (T, bool)
}
func Contains[T comparable](c Iterator[T], value T) bool {
for {
v, ok := c.Next()
if ok {