comp.lang.ada
 help / color / mirror / Atom feed
[parent not found: <mailman.181.1066858869.25614.comp.lang.ada@ada-france.org>]
* Re: += in ada
@ 2003-10-07 11:56 Lutz Donnerhacke
  2003-10-15 13:25 ` Hyman Rosen
  0 siblings, 1 reply; 7+ messages in thread
From: Lutz Donnerhacke @ 2003-10-07 11:56 UTC (permalink / raw)


* Dmytry Lavrov wrote:
> begin
> declare_new_name a _for_ X(b(i).all+7);
> -- for example, "a is X(b(i).all+7)"
> a:=a+2/a;
> end;

declare
   a : Typ renames X(b(i).all + 7);
begin
   a := a + 2/a;
end;   

is legal Ada and a common idiom.

> "+=" is a idea about in-place operations,and @ is about readability.

Both ideas fail on considering a consitent semantic for volatile types and
exception handling. In both cases it's necessary to require a temporary copy
of the LHS. So nothing is gained from this proposal, beside a clear semantic
about access frequency for volatile data (one read and one write access).

So I have to conlude, that the whole "idem" Idiom is useless at all.

In order to generate a more general solution, the S'Type attibute would
helpful, because it's possible to write:

declare
   a : a'Type renames X(b(i).all + 7);
begin
   a := a + 2/a;
end;   

> IMO,in place operations should be used as normal procedures like
> inc(a,b) or juliafractalstep(z,c);

Yep.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-10-23  7:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.180.1066854383.25614.comp.lang.ada@ada-france.org>
2003-10-22 20:58 ` Early Ada Mistakes (was: Re: += in ada) Ed Falis
     [not found] <mailman.181.1066858869.25614.comp.lang.ada@ada-france.org>
2003-10-22 21:49 ` Ed Falis
2003-10-23  3:21   ` Alexandre E. Kopilovitch
2003-10-23  7:15   ` Ole-Hjalmar Kristensen
2003-10-07 11:56 += in ada Lutz Donnerhacke
2003-10-15 13:25 ` Hyman Rosen
2003-10-15 14:04   ` Vinzent 'Gadget' Hoefler
2003-10-15 15:19     ` Hyman Rosen
2003-10-16  5:05       ` Russ
2003-10-16 13:43         ` Hyman Rosen
2003-10-16 23:57           ` Robert I. Eachus
2003-10-17  6:22             ` Russ
2003-10-17 15:48               ` Robert I. Eachus
2003-10-19  1:15                 ` Russ
2003-10-19 23:19                   ` Robert A Duff
2003-10-20  6:16                     ` Russ
2003-10-21  0:40                       ` Wes Groleau
2003-10-21  3:45                         ` Hyman Rosen
2003-10-21 12:45                           ` Marin David Condic
2003-10-22  0:14                             ` Wes Groleau
2003-10-22 12:31                               ` Early Ada Mistakes (was: Re: += in ada) Marin David Condic
2003-10-22 20:05                                 ` Robert I. Eachus
2003-10-23  4:47                                   ` Marin David Condic

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