Path: utzoo!attcan!uunet!mcvax!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.c Subject: Re: Efficient coding considered harmful? Message-ID: <7731@boring.cwi.nl> Date: 25 Nov 88 01:36:43 GMT References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <7700@bloom-beacon.MIT.EDU> <771@wsccs.UUCP> <437@auspex.UU <592@tuck.nott-cs.UUCP> <503@auspex.UUCP> Organization: CWI, Amsterdam Lines: 33 > > Of course, the real solution to the "varargs" problem, not possible > >in C because of the dead hand of history, is to use extra brackets, so that > >every function has a fixed number of arguments: > > > > printf ("%d %c %s\n", (i, c, "hello world")); > > ^...arg1...^, ^.......arg2........^ > > > > Now, what language did I see that nifty idea in? [:-)] (For those who do not know, Algol 68) > > OK, so what is the data type of > > (i, c, "hello world") > > Just adding extra brackets wouldn't have been sufficient; it leaves > questions such as that one.... It is an 'array display', i.e. the second parameter is an array whose components are a union of a lot of things. The extra brackets are required as there is (in Algol 68) a difference between: print(a, b, c) and print((a, b, c)) the first calls print with three parameters (which is illegal), the second with only one. -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax