Skip to content

Latest commit

 

History

History
 
 

bin

命令

# 编译 go
make.bat -v --no-clean

# 运行
go tool go2go run monoid.go2

# 翻译
go tool go2go translate monoid.go2

参考

问题

// ------------------
 func Smallest<type T comparable>(s []T) T {
 	r := s[0] // panic if slice is empty
 	for _, v := range s[1:] {
 		if v < r { // INVALID, cannot compare v < r (operator < not defined for T)
 			r = v
 		}
 	}
 	return r
 }