comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@gmail.com>
Subject: Re: Surprising behaviour of strings.fixed.overwrite
Date: Wed, 12 Nov 2014 07:49:17 -0800 (PST)
Date: 2014-11-12T07:49:17-08:00	[thread overview]
Message-ID: <487cd979-9693-478c-9eac-268e1a0d37c8@googlegroups.com> (raw)
In-Reply-To: <m3vdvn$uu$1@speranza.aioe.org>

On Wednesday, November 12, 2014 2:49:33 AM UTC-8, Markus Schöpflin wrote:

> Well, I would have expected the output to be
> 
> @@@@@6
> @@@@@5
> 
> But it is:
> 
> @@@@56
> @@@@@5
> 
> Which is correct according to the definition of overwrite, but nevertheless I 
> find this extremely surprising.
> 
> Am I alone in this?
> 
> Or can anyone please the rational on defining the behaviour of overwrite as it is?

I agree that it's odd.  However, it does make some sense that the Overwrite *function* would return a 7-character String in the first case, although that also isn't the effect I would have expected at first (since the characters that get appended to the string aren't overwriting anything).  I can imagine how this kind of result from the function would be useful.  I'm guessing, though, that this possible behavior of the function was missed when it was decided to define the procedure's semantics in terms of the function.

                                -- Adam


  parent reply	other threads:[~2014-11-12 15:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 10:49 Surprising behaviour of strings.fixed.overwrite Markus Schöpflin
2014-11-12 12:55 ` G.B.
2014-11-12 15:49 ` Adam Beneschan [this message]
2014-11-12 23:19 ` Randy Brukardt
2014-11-13  8:15   ` Markus Schöpflin
2014-11-13 12:40     ` Simon Wright
2014-11-13 12:56       ` Markus Schöpflin
replies disabled

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