but intended to write
A long debugging session was required to discover that
I gave 4 params, but
f expected only 3.
The 4th parameter defaulted to
A simple compiler-check (count parameters), would have caught this typo. Instead it caused a mystery.
I would guess that parameter defaulting was inserted into the language in-search-for user-friendliness.
This is not user friendly.
Full-blown type-checking would not have been necessary here.
Re-Structuring Semantics Checking?
Hmm, we use a parser to check for stupid errors.
We don’t waste time waiting for a full type-check, if the parser caught stupid errors.
Maybe a pre-check pass should be inserted between the parser and the full-blown semantics checker?
How does this affect language design and user-friendliness? And, gradual typing?
Maybe languages shoud be structured to allow experimentation, then, whine about “not enough information (detail) to compile” later?