Newsgroups: comp.lang.c++ Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Formatted Output Revisited Message-ID: <1989Oct16.230058.26368@utzoo.uucp> Organization: U of Toronto Zoology References: <738@tuvie> Date: Mon, 16 Oct 89 23:00:58 GMT In article <738@tuvie> inst182@tuvie (Inst.f.Techn.Informatik) writes: > + no optimization can be done; if you want to output > even a trivial thing like form("d=%d\n",d) and you > have to parse the output string over and over again. Why? All it takes is a compiler that knows about library functions to optimize this. (No, this is not "contrary to the spirit of C"; there are already C compilers that do it, and ANSI C has blessed it.) > + since form() is declared as somthing like > char *form(char *format, ...); > no typechecking can be done... Again, dunno about C++, but there are C compilers that type-check calls to printf(), so form() should be checkable. > + Extending form to handle user-defined types is impossible. This is *probably* true. -- A bit of tolerance is worth a | Henry Spencer at U of Toronto Zoology megabyte of flaming. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu