JuliaLang/julia — pull request #7175 by waTeim (2014-06-08 20:11:33+00:00)
Title: @printf modification for splatted arguments and runtime argument comparison

This is a change to @printf to allow it to process spatted arguments. Previously, the number of arguments were compared and used strictly positionally which could be cumbersome. With this change, the argument list is expanded and spatted arguments become separated. Thus the following becomes possible

julia> @printf("%d %d",[1 2]...);
1 2

And even more complicated things are possible like comprehensions

julia> @printf("%d %d %d %d",{ i^3 for i = 1:4}...);
1 8 27 64

As before argument cardinality is compared to the format string, but this is postponed until runtime rather than macro expansion time.

julia> @printf("%d %d",[1 2 3]...);
ERROR: @printf: wrong number of arguments (3) should be (2)
in error at error.jl:22