tech:notes_go_lang_programmation_fonctionnelle
Ceci est une ancienne révision du document !
Notes go lang programmation fonctionnelle
map
Voir :
package main import "fmt" type f_ii func(int) int func MapInt(f f_ii, l []int) [](int) { ret := []int{} for _, v := range l { ret = append(ret, f(v)) } return (ret) } func carre(i int) int { return i * i } func main() { liste := []int{1, 2, 3} fmt.Println(MapInt(carre, liste)) }
tech/notes_go_lang_programmation_fonctionnelle.1776112697.txt.gz · Dernière modification : de Jean-Baptiste
