3 ms·
Not the most interesting of questions I have here, but is this indentation style on function definitions a thing or is it just accidental? It's in a few places
by sodapopcan 3y ago
Not the most interesting of questions I have here, but is this indentation style on function definitions a thing or is it just accidental? It's in a few places, mostly before the first arg but sometimes before others.
eg:
function run_command( c, shortopts, longopts, quiet, directory, path, errors)
Just asking as this project has kind of resparked my interest in awk.
- michaelcampbell 3y agoI noticed this too and can't figure it out. Spaces between SOME parameters, not all, and not consistently placed
- rbonvall 3y agoAwk doesn't have a way to define function-local variables. All variables are global, except for function parameters. This spacing convention is meant to clearly separate mandatory parameters and optional parameters that are sometimes only introduced to "declare" a local variable.
- bewuethr 3y agoHere's where the manual introduces the convention: https://www.gnu.org/software/gawk/manual/gawk.html#Variable-Scope https://www.gnu.org/software/gawk/manual/gawk.html#Variable-...
- sodapopcan 3y agoOh cool, thank you!!
- michaelcampbell 3y agoThanks; this may be one of the most weird conventions I've ever come across. Maybe that's a 'me' thing.
- deleted 3y ago[deleted]