From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9fa5063fbdc75ae4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 10:58:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: array of strings in a function References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 16 Oct 2003 17:58:08 GMT NNTP-Posting-Host: 63.184.9.21 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1066327088 63.184.9.21 (Thu, 16 Oct 2003 10:58:08 PDT) NNTP-Posting-Date: Thu, 16 Oct 2003 10:58:08 PDT Xref: archiver1.google.com comp.lang.ada:1005 Date: 2003-10-16T17:58:08+00:00 List-Id: tmoran@acm.org wrote: >>You can't have a subprogram with an unknown number of parameters, which >>is what you've been trying to write. > > But you can certainly have a set of subprograms with the same name > but differing number of parameters: > procedure my_fun(s1 : in string) is ... > procedure my_fun(s1,s2 : in string) is ... > procedure my_fun(s1,s2,s3 : in string) is ... > procedure my_fun(s1,s2,s3,s4 : in string) is ... > or you could use default values > procedure my_fun(s1 : string; -- require at least one parameter > s2 : string := ""; > s3 : string := ""; > s4 : string := "") is .. Certainly. But to handle an arbitrary number of parameters, you have to write an arbitrary number of something (subprograms or parameters with defaults), which is impossible. An unconstrained array type allows you to handle an unbounded number of items with a single parameter (unbounded in the same sense as Unbounded_String). -- Jeff Carter "Perfidious English mouse-dropping hoarders." Monty Python & the Holy Grail 10