[Info-vax] LLVM, volatile and async VMS I/O and system calls
chris
chris-nospam at tridac.net
Sun Oct 3 19:32:24 EDT 2021
On 10/03/21 19:18, Dave Froble wrote:
>
> What I find a bit funny is all an optimizer does is corrects poorly
> written code. People get into habits, and it can be hard to break some
> habits.
>
> As an example, back in the day, the RSTS Basic+ interpreter had an
> interesting quirk. For example:
>
> A = "abc"
> B = A
>
> One would expect the value in A to be placed in the location where the
> pointer to B points. However, Basic+ would change the pointer to B to
> the value of the pointer to A, thus losing the old location of B. I
> think this happened with strings, don't really remember, it has been a
> very long time.
>
> Now consider that the pointer to B was in an I/O buffer. After the
> operation, B would no longer be pointing into the I/O buffer. Perhaps
> not such a good thing. (Actually a horrible thing!)
>
> What people learned to do is:
>
> B = A + ""
>
> That would insure moving of the data, not the pointer. With BP2 and
> later, this odd operation was not an issue. But, even today, I find
> people still using that old habit of appending the null string to an
> operation.
>
> Bad habits are hard to kill.
>
Interesting. Never familiar with Basic, but looks like an empty
string is being concatenated onto the existing string and forcing
a read of the original and subsequent write of B, ensuring
consistency ? So what happens if the null string is omitted ?...
Chris
More information about the Info-vax
mailing list