3 ms·
Interestingly, this way of function definitions is "still" the way subroutines/functions are defined in (modern/all time) Fortran (if one ignores the syntactic
by ktpsns 8y ago
Interestingly, this way of function definitions is "still" the way subroutines/functions are defined in (modern/all time) Fortran (if one ignores the syntactic differences). Also, at "old" C, declarations only may come at the beginning of a block -- just as it still is with Fortran. Out of curiosity, is there any reason for the similiarity?
- ethhics 8y agoAt least for the declarations at the beginning of the block, that allows for very simple compiler design as it is very easy to split the code and data sections. Start off allocating space for all the variables it sees, and then when it reaches something not a declaration or definition, start emitting assembly.