lang/interpret_test/TestAstFunc2/func-math2.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "fmt" |
| 3 | import "math" |
| 4 | |
| 5 | # XXX: do the input nodes to _operator look weird here? in my testing I saw |
| 6 | # fortytwo appear, and then disappear before we finished running... |
| 7 | # function statement |
| 8 | func sq1($x) { |
| 9 | $x + 3 |
| 10 | } |
| 11 | |
| 12 | $x1 = sq1(math.fortytwo()) |
| 13 | |
| 14 | test [fmt.printf("sq1: %d", $x1),] {} |
| 15 | |
| 16 | -- OUTPUT -- |
| 17 | Vertex: test[sq1: 45] |