News for hackers. Stuff that matters.
Re:Phrase origin: Why do we "call" functions? by titanomachy on Wednesday July 09, 2025 @01:02AM (#44506467)
That's a great question. The first language I learned was python, and "for i in range(10)" makes a lot of sense to me. But "for (int i = 0; i < 10; i++)" must have come first, and in that case "for" is a less obvious choice.
Re:Phrase origin: Why do we "call" functions? by Dwedit on Wednesday July 09, 2025 @01:11AM (#44506505)
BASIC had the FOR-NEXT loop back in 1964.

10 FOR N = 1 TO 10

20 PRINT " ";

30 NEXT N

C language would first release in 1972, that had the three-part `for` with assignment, condition, and increment parts.

Re:Phrase origin: Why do we "call" functions? by kahirsch on Wednesday July 09, 2025 @02:44AM (#44506971)
This reminds me of a little bit of trivia. In very old versions of BASIC, "FORD=STOP" would be parsed as "FOR D = S TO P".

I found that amusing circa 1975.

Re:Phrase origin: Why do we "call" functions? by zabzonk on Wednesday July 09, 2025 @01:18AM (#44506544)
In Fortran, it is a do-loop :)
Re:Phrase origin: Why do we "call" functions? by bee_rider on Wednesday July 09, 2025 @01:41AM (#44506646)
Fortran has grown a lot over time. If somebody said it don’t have a do loop in 196X, I wouldn’t be too surprised.

Really it’s just syntactic sugar, just use a goto.

Re:Phrase origin: Why do we "call" functions? by pklausler on Wednesday July 09, 2025 @02:38AM (#44506939)
The entire point of Fortran was being an effective optimizing compiler for DO loops.
Re:Phrase origin: Why do we "call" functions? by bregma on Wednesday July 09, 2025 @12:23PM (#44511900)
FORTRAN IV, at least the version I used on the PDP-11 running RSX, did not have a DO-loop. Just IF and GO TO. But it did have both logical and arithmetic IF.
Re:Phrase origin: Why do we "call" functions? by pklausler on Wednesday July 09, 2025 @06:49PM (#44515503)
I don’t believe this.
Re:Phrase origin: Why do we "call" functions? by masklinn on Wednesday July 09, 2025 @01:16AM (#44506536)
FOR comes from ALGOL in which as far as I know is was spelled:

    for p := x step d until n do
Re:Phrase origin: Why do we "call" functions? by QuesnayJr on Wednesday July 09, 2025 @01:29AM (#44506602)
Algol 58 had "for i:=0(1)9". C's for loop is a more general variant.