comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Rust's temporal safety for Ada/SPARK
Date: Mon, 15 May 2017 21:30:00 +0200
Date: 2017-05-15T21:30:00+02:00	[thread overview]
Message-ID: <ofcvdf$4fr$1@dont-email.me> (raw)
In-Reply-To: <lyd1bahray.fsf@pushface.org>

On 05/15/2017 09:07 PM, Simon Wright wrote:
>
> I was thinking that an alternative subject area might be code like
>
>       procedure Add (Dest : in out Integer; N : Integer)
>         with
>           Post => Dest = Dest'Old + N;
>
>       procedure Add (Dest : in out Integer; N : Integer)
>       is
>       begin
>          Dest := Dest + N;
>       end Add;
>
>       Dest : Integer := 42;
>
>    ...
>
>       Add (Dest, Dest);
>
> (where we have alternate paths to the variable Dest); but SPARK is happy
> and the runtime check isn't triggered, so I suppose the ARM supports
> this (by copy-out?).

Elementary types are passed by copy, so you don't have any paths to the variable 
Dest inside Add. That's why this is OK. If the type might be by reference, 
though, this can be a problem.

-- 
Jeff Carter
"Strange women lying in ponds distributing swords
is no basis for a system of government."
Monty Python & the Holy Grail
66

  reply	other threads:[~2017-05-15 19:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 20:33 Rust's temporal safety for Ada/SPARK digitalkevlar
2017-05-13 21:19 ` Jeffrey R. Carter
2017-05-14 10:19   ` Niklas Holsti
2017-05-15 19:07   ` Simon Wright
2017-05-15 19:30     ` Jeffrey R. Carter [this message]
2017-05-17 21:21     ` moy
2017-05-14  3:24 ` Robert Eachus
2017-05-14 16:46 ` digitalkevlar
2017-05-14 17:18   ` Dmitry A. Kazakov
2017-05-14 17:36   ` Jeffrey R. Carter
2017-05-14 19:59     ` Niklas Holsti
2017-05-14 20:43       ` Simon Wright
2017-05-15  7:27         ` Dmitry A. Kazakov
2017-05-14 22:20       ` Dennis Lee Bieber
2017-05-15 16:23       ` Jeffrey R. Carter
2017-05-15 23:19     ` Randy Brukardt
2017-05-16 16:45       ` Shark8
2017-05-16 21:36         ` Randy Brukardt
2017-05-16 23:37           ` Shark8
2017-05-14 21:28 ` moy
2017-05-15 22:59 ` digitalkevlar
replies disabled

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