On Sun, Apr 12, 2015 at 02:33:03PM +0000, ketmar via Digitalmars-d-learn wrote: > On Sun, 12 Apr 2015 14:18:21 +0000, JR wrote: > > > But the compiler has all the pieces of information needed to see > > it's wrong, doesn't it? > > no, it doesn't. compiler doesn't know about `std.format.format` and > it's special abilities. while it is possible to add such checks to the > compiler, it will introduce interdependency between compiler and > phobos, which is not desirable. > > writing CTFE `writef` version is possible without template bloat in > binary, but it will take more memory in compile time and slows > compilation. there were talks about having `writef!"fmt"(args)` in > phobos, but nobody took that task yet.
It's not hard to write a CTFE version of writef/writeln/etc., that takes the format argument at compile-time, since std.format itself is already CTFE-able. All it takes is for somebody to step up to the plate and implement it. T -- Genius may have its limitations, but stupidity is not thus handicapped. -- Elbert Hubbard