comp.lang.ada
 help / color / mirror / Atom feed
From: Lucretia <laguest9000@googlemail.com>
Subject: Re: Basics : many way to use a Procedure
Date: Sat, 12 Dec 2015 02:47:48 -0800 (PST)
Date: 2015-12-12T02:47:48-08:00	[thread overview]
Message-ID: <52a3a1e7-21ad-42b7-91ad-6cef89259a55@googlegroups.com> (raw)
In-Reply-To: <6caaac83-bca4-4b75-a4b3-47189e281c1a@googlegroups.com>

On Friday, 11 December 2015 22:19:55 UTC, comicf...@gmail.com  wrote:
> Hello !
> 
> I'm seeing that some people use procedure with the sign " => " .
> What is it ? Any documentation about this ? 
> 
> A example =
> 
> Ada.Text_IO.Create (
>           File => Log_File,
>           Name => "my_log_file.txt",
>           Mode => Ada.Text_IO.Out_File);

It's called named parameter association. It allows you to change the order of the parameters passed to a function/procedure to one that makes reading easier or just your own preference.

> which is very similar to the prototype :
> 
>  procedure Open
>      (File : in out File_Type;
>       Mode : File_Mode;
>       Name : String;
>       Form : String := "");

For example, given the proper context clauses:

Open (Name => "hello.txt", File => My_File, Mode => In_File);

or you can use it partially, as in:

Open (My_File, Name => "hello.txt", Mode => In_File);

> Also , is it possible to apply this kind of writing  for this procedure ? =

You can apply it to all functions/procedures. 

Luke.


  parent reply	other threads:[~2015-12-12 10:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 22:19 Basics : many way to use a Procedure comicfanzine
2015-12-12  0:00 ` Jeffrey R. Carter
2015-12-12  3:25 ` comicfanzine
2015-12-12  8:01   ` Niklas Holsti
2015-12-12 10:59   ` mockturtle
2015-12-14 10:52   ` Mark Lorenzen
2015-12-12 10:47 ` Lucretia [this message]
2015-12-12 14:41 ` comicfanzine
2015-12-12 17:11   ` Jeffrey R. Carter
2015-12-12 19:28   ` Simon Wright
2015-12-12 19:59     ` comicfanzine
2015-12-12 20:06     ` comicfanzine
2015-12-12 20:31       ` Simon Wright
2015-12-12 21:54         ` comicfanzine
2015-12-12 22:15         ` comicfanzine
2015-12-12 22:33           ` Jeffrey R. Carter
2015-12-13 15:22             ` comicfanzine
2015-12-13 15:29             ` comicfanzine
2015-12-13 15:34             ` comicfanzine
replies disabled

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