comp.lang.ada
 help / color / mirror / Atom feed
* Aspect location in expression function.
@ 2022-05-14 11:47 Blady
  2022-05-14 15:40 ` J-P. Rosen
  0 siblings, 1 reply; 8+ messages in thread
From: Blady @ 2022-05-14 11:47 UTC (permalink / raw)


Hello,

I'm puzzled when I want to changed a function body with aspects to an 
expression function, for instance:

function Length (S : Some_Tagged_Tyoe) return Natural
   with Pre => S.Valid
   is
   begin
   return S.Length;
   end;

have to be changed in:

function Length (S : Some_Tagged_Tyoe) return Natural
   is (S.Length)
   with Pre => S.Valid;

The location of the aspect has moved to the end.

I'd like simply replace the begin block by the expression, as:

function Length (S : Some_Tagged_Tyoe) return Natural
   with Pre => S.Valid
   is (S.Length);

What could be any reasons not to permit it?

Thanks, Pascal.

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

end of thread, other threads:[~2022-05-25 18:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14 11:47 Aspect location in expression function Blady
2022-05-14 15:40 ` J-P. Rosen
2022-05-24  4:05   ` Randy Brukardt
2022-05-24 10:01     ` J-P. Rosen
2022-05-25  5:17       ` Randy Brukardt
2022-05-24 18:24     ` G.B.
2022-05-25  5:20       ` Randy Brukardt
2022-05-25 18:45         ` G.B.

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