June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,20 @@
package main
import (
"fmt"
)
type params struct {x, y, z int}
func myFunc(p params) int {
return p.x + p.y + p.z
}
func main() {
r := myFunc(params{x: 1, y: 2, z: 3}) // all fields, same order
fmt.Println("r =", r)
s := myFunc(params{z: 3, y: 2, x: 1}) // all fields, different order
fmt.Println("s =", s)
t := myFunc(params{y: 2}) // only one field, others set to zero
fmt.Println("t =", t)
}

View file

@ -3,3 +3,9 @@ sub funkshun ($a, $b?, :$c = 15, :$d, *@e, *%f) {
say join ' ', @e;
say join ' ', keys %f;
}
# this particularly thorny call:
funkshun
'Alfa', k1 => 'v1', c => 'Charlie', 'Bravo', 'e1',
d => 'Delta', 'e2', k2 => 'v2';