Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!portal!cup.portal.com!Tim_CDC_Roberts From: Tim_CDC_Roberts@cup.portal.com Newsgroups: comp.lang.c Subject: Re: parsing the format string at compile time... Message-ID: <23054@cup.portal.com> Date: 13 Oct 89 20:30:31 GMT References: <705@nixbur.UUCP> <11262@smoke.BRL.MIL> Distribution: usa Organization: The Portal System (TM) Lines: 23 Regarding Modula-2 requiring the programmer to parse format strings: C++ is very much like this, if you think about it. printf ("%d %s %d\n", 123, "What?", 456"); becomes: cout << 123 << ' ' << "What?" << ' ' << 456; There are separate, overloaded definitions of the '<<' operator, each of which knows how to format a particular type. Ada kind of mixes the two. You make a separate function call for each item (like Modula-2), but they all have the same function name (thanks to overloading). put (123); put (" "); put ("What?"); -- ... Tim_CDC_Roberts@cup.portal.com | Control Data... ...!sun!portal!cup.portal.com!tim_cdc_roberts | ...or it will control you.