🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2100

Re: Variable param for non-vararg subr. calls

#2100
From: Jens M Andreasen
Date: Thu, 29 Feb 1996 00:29
25 lines
1456 bytes

On 26 Feb 1996, John Shalf wrote:

> 
> Varargs allows you to unpack a variable number of arguments from a 
> subroutine call at runtime.  You would think there would be a way to 
> *pack* a variable number of arguments for a subroutine call at runtime.

Seems like your code kind of do what you intended, but ... 

1) Either you know what function you are (eventually) going to call, and 
   then there are more straightforward ways of collecting the arguments.

2) Or, you don't know what function you are going to call, and then there 
   will be no way to know what sensible arguments to collect?

The example works because you know what arguments to pass to the 
testfunction, so why not just call it? If the arguments or the function 
is changed, then the program stops making sense!? The way I see it, the 
most efficient way to pack the arguments is by calling the function. This 
_is_ the "packing of variables at runtime". Or did you have something 
else in mind?

// Jens M Andreasen
Technical Details
Message-ID: <4h2s0j$k9@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4gsaai$41m@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: Jens M Andreasen <jens-and@dsv.su.se>
Newsgroups: comp.lang.c.moderated
Subject: Re: Variable param for non-vararg subr. calls
Date: 28 Feb 1996 18:29:07 -0600
Organization: Digital Solutions
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4h2s0j$k9@solutions.solon.com>
References: <4gsaai$41m@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com