🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5957

Re: Variable arguments in macros

#5957
From: Karl Heuer
Date: Fri, 28 Apr 1989 00:21
13 lines
1136 bytes
In article <58345@yale-celray.yale.UUCP> leichter@CS.YALE.EDU (Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)) writes:
>[allow an ellipsis in the macro parameters, and have a builtin macro _REST_
>which] expands to the list of remaining arguments, including a leading comma
>if there is at least one such argument.

Not good enough.  Consider:
	#define f(a,b,...) (g(a,b),h(_REST_))
in which, for syntactic correctness, _REST_ must exclude the leading comma.
I suspect this was the major reason that variadic macros didn't make it into
the Standard: there was no clean proposal that handled the case with zero
additional args.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint
Technical Details
Message-ID: <12839@haddock.ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!decvax!ima!haddock!karl
References: <58345@yale-celray.yale.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!decvax!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: Variable arguments in macros
Message-ID: <12839@haddock.ima.isc.com>
Date: 28 Apr 89 00:21:14 GMT
References: <58345@yale-celray.yale.UUCP>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 13