Comment by weinzierl
5 days ago
"He never calls subroutines "functions"; I'm not sure where that usage comes from, but certainly by BASIC and LISP there were "functions" that were at least implemented by subroutines."
I think the early BASIC's used the subroutine nomenclature for GOSUB, where there was no parameter passing or anything, just a jump that automatically remembered the place to return.
Functions in BASIC, as I remember it, were something quite different. I think they were merely named abbreviations for arithmetic expressions and simple one line artithmetic expressions only. They were more similar to very primitive and heavily restricted macros than to subroutines or functions.
Right, that's what Algol-58 functions were, too. I think FORTRAN also has a construct like this, but I forget.
FORTRAN had both functions and subroutines. A function returned a value and was invoked in an expression (eg. S=SIN(A)). A subroutine was invoked by calling it (eg. CALL FOPEN(FNAME, PERMS)).
I should probably just Google this, but how did you define the functions?
6 replies →