lang/interpret_test/TestAstFunc2/fortytwowrapped.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "fmt" |
| 3 | import "math" |
| 4 | # FIXME: floats don't print nicely: https://github.com/golang/go/issues/46118 |
| 5 | # FIXME: This means that we see "42" for both, instead of 42.0 ... |
| 6 | |
| 7 | func myfortytwo() { |
| 8 | math.fortytwo() |
| 9 | } |
| 10 | |
| 11 | test [fmt.printf("int: %d", myfortytwo()),] {} |
| 12 | test [fmt.printf("float: %f", myfortytwo()),] {} |
| 13 | -- OUTPUT -- |
| 14 | Vertex: test[float: 42] |
| 15 | Vertex: test[int: 42] |