Files
mgmt/examples/lang/printf0.mcl
James Shubin e9791ff92c lang: funcs: core: fmt: Add variant verb for printf
There's no reason we can't support a %v variant verb. Of course it makes
type unification more difficult, and certain uses of this will produce
unsolvable situations, but it's useful for debugging, and fun to have.
2021-10-11 00:36:29 -04:00

11 lines
197 B
Plaintext

import "fmt"
test "printf-a" {
anotherstr => fmt.printf("the %s is: %d", "answer", 42),
}
$format = "a %s is: %f"
test "printf-b" {
anotherstr => fmt.printf($format, "cool number", 3.14159),
}