|
|
|
|
|
by tunesmith
3813 days ago
|
|
You have two parameters - a vector of size "m", and a vector of size "n". The function signature then expects to get back a vector of size "m + n". Contrast that with a language with method signatures that can only return types like "Vector" or "List", without any information that is dependent on the incoming parameters. So then, the logic is checked - if the method returns a vector that is anything other than the size of the two incoming parameter vector sizes added together, it won't compile. In other words, even more behavior that would normally be a runtime bug is checked at compile time, which is a good thing if you are working in a domain where correctness is important and want to avoid runtime bugs. |
|