[Info-vax] LLVM, volatile and async VMS I/O and system calls
Dave Froble
davef at tsoft-inc.com
Sun Oct 3 21:44:52 EDT 2021
On 10/3/2021 7:32 PM, chris wrote:
> 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
Now, nothing unusual. That was a Basic+ quirk. All compiled Basic does
the right thing.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list