RE: In-Out Parameters for functions
From: amado.alves (amado.alves_at_netcabo.pt)
Date: 01/23/04
- Next message: Robert C. Leif: "Assert pragma"
- Previous message: Jerry Petrey: "Re: Any ADA NASA Developer's out there?"
- Next in thread: Jean-Pierre Rosen: "Re: In-Out Parameters for functions"
- Reply: Jean-Pierre Rosen: "Re: In-Out Parameters for functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jan 2004 15:59:51 -0000 To: <comp.lang.ada@ada-france.org>
"I don't follow, and I would like to, because I find [IN] OUT params
for functions very useful. Could you please elaborate on that a bit
more?"
Maybe the most common example is the idiom (illegal in Ada):
while Next (Item) loop
Do_Something (Item);
end loop;
where the Next function returns false in no more items are available,
and Item is an (illegal) in out parameter which holds the result of
a 'successful' call (and holds garbage on unsuccessful calls--this is
the ugly bit). The above idiom is perhaps the most clean solution for
the associated problem. I know I invariably use it when I write in C.
(Sorry for the possibly illformatted text.
I'm stuck with a crapy webmail system.)
- Next message: Robert C. Leif: "Assert pragma"
- Previous message: Jerry Petrey: "Re: Any ADA NASA Developer's out there?"
- Next in thread: Jean-Pierre Rosen: "Re: In-Out Parameters for functions"
- Reply: Jean-Pierre Rosen: "Re: In-Out Parameters for functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|