github.com/neugram/ng@v0.0.0-20180309130942-d472ff93d872/eval/testdata/func.ng (about)

     1  type x func(func(), func(*int)) func(x, y int, z *struct{})
     2  
     3  ok := true
     4  ycalled := false
     5  y := x(func(func(), func(*int)) func(int, int, *struct{}) {
     6  	ycalled = true
     7  	return nil
     8  })
     9  z := y(nil, nil)
    10  if !ycalled {
    11  	print("y not called")
    12  	ok = false
    13  }
    14  if z != nil {
    15  	print("z not nil")
    16  	ok = false
    17  }
    18  
    19  func ff(x, y float64) float64 { return x + y }
    20  ff( 11,  22)
    21  ff(+11, +22)
    22  ff(-11, -22)
    23  ff(+11, -22)
    24  ff(-11, +22)
    25  ff( 11.0,  22.0)
    26  ff(+11.0, +22.0)
    27  ff(-11.0, -22.0)
    28  ff(+11.0, -22.0)
    29  ff(-11.0, +22.0)
    30  
    31  if ok {
    32  	print("OK")
    33  }