[GAP] old attribute

Robert Dewar dewar at adacore.com
Sun Oct 30 23:49:13 CET 2011


On 10/30/2011 6:46 PM, Robert Dewar wrote:
> On 10/29/2011 4:13 PM, Jean-Pierre Rosen wrote:
>
>> But if you need a deep copy, you should define your type as controlled,
>> and the definition of Adjust will do the trick (Too lazy to check in the
>> RM, but I hope and believe that 'Old uses a regular assignment)
>
> This seems wrong to me, typically we are talking about postconditions
> in the low level routines that mess with these linked lists etc. You
> don't want casual deep copies in that context, but you do need the
> deep copy for saving the old value.
>
To see that in its most vivid form, consider that this postcondition
is being used in the routine that does an elaborate optimized deep
copy operation!


More information about the GAP mailing list