[TUHS] origin of string.h and ctype.h

Charles Anthony charles.unix.pro at gmail.com
Mon Aug 14 08:26:09 AEST 2017


On Sun, Aug 13, 2017 at 2:55 PM, Johnny Billquist <bqt at update.uu.se> wrote:

> On 2017-08-13 19:24, Dave Horsfall <dave at horsfall.org> wrote:
>
>> On Sat, 12 Aug 2017, Steve Johnson wrote:
>>
>>> A little Googling shows that the IF I mentioned was called the
>>> "arithmetic IF".
>>>
>> Ah yes.  It was in FORTRAN II, as I recall.
>>
>
> Still there in FORTRAN 77.
>
>  There was also a Computed GOTO that branched to one of N labels
>>> depending on the value of the expression.
>>>
>> I think that was still in FORTRAN IV?
>>
>
> Still there in FORTRAN 77.
>
>  And an Assigned GOTO whose main use, as I remember, was to allow for
>>> error recovery when a subroutine failed...
>>>
>> A real ugly statement; you assigned a statement number to a variable, then
>> did a sort of indirect GOTO (or did the compiler recognise "GOTO I")?
>>
>
> The compiler recognize "GOTO I". And I have to be assigned to a statement
> number (label). It has to be an integer variable, and when you assign it to
> a label, you cannot do any arithmetic with it anymore. And you assign it
> with a special statement. Thus, it can be used to store what label to jump
> to, but you cannot use arithmetic to set what it should jump to.
>
> How those poor devils ever debugged their code with such monstrous
>> constructions I'll never know.
>>
>
> It's actually not that hard. All this stuff is fairly simple to deal with.
> The real horror in FORTRAN is EQUIVALENCE, which can give C a fair fight
> for real horror stories.
>

IIRC, PRIMOS was written in FORTRAN, and they had an extension where you
could pass assigned GOTO variables as parameters and to jump globally; I
don't recall the stack semantics, but I would guess setjmp/longjmp style.

-- Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170813/fbac560f/attachment.html>


More information about the TUHS mailing list