py/test.go

29 lines
514 B
Go
Raw Normal View History

2014-02-21 21:25:11 +01:00
package main
import (
. "./py"
"fmt"
)
func main(){
test := []interface{}{
Sum(Map(func (x int) int {return x*x}, Range(30))),
Chr(89),
Ord("a"),
Bin(144),
Hex(5831),
Bool(1.2),
Abs(-19.3),
Pow(2,16),
Type(true),
2014-03-01 16:48:45 +01:00
Open("test.txt", "a+"),
Any([]interface{}{0, 1, []int{}, ""}),
2014-03-02 15:31:27 +01:00
All([]interface{}{true, "", 1}),
Min([]float64{3.14159, 23.14069, 2.71828}),
2014-03-01 16:48:45 +01:00
Max(-3,24,1,-23,31),
2014-03-02 15:31:27 +01:00
Join(", ", []interface{}{2, -2.33, true, "hi"}),
Input("Say hi! "),
}
2014-03-02 15:28:48 +01:00
fmt.Println(Join("\n",test))
2014-02-21 21:25:11 +01:00
}