comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Variable list parameters
Date: Mon, 26 Nov 2007 08:52:12 -0800
Date: 2007-11-26T08:52:12-08:00	[thread overview]
Message-ID: <w_udnZMiDO0dZNfanZ2dnUVZ_ryqnZ2d@comcast.com> (raw)
In-Reply-To: 9e4ce016-d6ab-49de-b6f7-e46c59e047b1@t47g2000hsc.googlegroups.com

<shaunpatterson@gmail.com> wrote in message 
news:9e4ce016-d6ab-49de-b6f7-e46c59e047b1@t47g2000hsc.googlegroups.com...
> Does Ada have variable length parameter lists?
>
> i.e  void printf (char *, ...)

No.

You can achieve similar results by making a variable length array and 
passing the array as an parameter:

   type arg_array is array( Positive range <> ) of integer;

   procedure process_args( args : arg_array ) is
   begin
     null;
   end process_args;

...

   process_args( ( 1, 2, 3 ) );

If you need to have different argument types you can either make the 
elements of the array tagged or variant types.

Regards,
Steve
(The Duck)

>
> Thanks 





  reply	other threads:[~2007-11-26 16:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 15:44 Variable list parameters shaunpatterson
2007-11-26 16:52 ` Steve [this message]
2007-11-26 18:44   ` tmoran
2007-11-26 19:00   ` Robert A Duff
2007-11-28  8:48     ` axtens
2007-11-28 20:21       ` amado.alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox