Many programming languages allow trailing commas in their grammar following the last item in a list. Supposedly this was done to simplify automatic code generation, which is
I just found out that a g77 Fortran compiler has the -fugly-comma
Ugly Null Arguments flag, though it's a bit different (and as the name implies, rather ugly).
The
-fugly-comma
option enables use of a single trailing comma to mean “pass an extra trailing null argument” in a list of actual arguments to an external procedure, and use of an empty list of arguments to such a procedure to mean “pass a single null argument”.For example,
CALL FOO(,)
means “pass two null arguments”, rather than “pass one null argument”. Also,CALL BAR()
means “pass one null argument”.
I'm not sure which version of the language this first appeared in, though.