Expressions now support function definition

This commit is contained in:
2024-04-02 04:36:03 +02:00
parent f58ec3ac32
commit 072dab4144
20 changed files with 376 additions and 143 deletions
+12
View File
@@ -101,3 +101,15 @@ func anyFloat(v any) (float float64, ok bool) {
}
return
}
func CopyMap[K comparable, V any](dest, source map[K]V) map[K]V {
for k, v := range source {
dest[k] = v
}
return dest
}
func CloneMap[K comparable, V any](source map[K]V) map[K]V {
dest := make(map[K]V, len(source))
return CopyMap(dest, source)
}