Menu

#48 Format: callback to modify arguments

open
nobody
None
5
2009-05-09
2009-05-09
Anonymous
No

in Ruby it's easy to transmute the members of an array

a1 = %w{ a b c }
a2 = a1.collect{ |x| "<#{x}>" } # => [ '<a>', '<b>', '<c>' ]

in FastFormat, maybe something like

fastformat::fmtfilter(std::cout, filter, "{0} {1} {2}", "a", "b", "c");

filter would be an object/function that would get called back for each argument, and be able to modify it prior to forming the result

Discussion