marekjm / viuavm

Parallel virtual machine designed to reliably run massively concurrent programs
https://viuavm.org/
GNU General Public License v3.0
71 stars 11 forks source link

Arity checks for functions which specify it #140

Closed marekjm closed 8 years ago

marekjm commented 8 years ago

Calls to functions whose names end with /N where N is an integer should be checked for arity match. For example, if a function foo/2 is not called with exactly two arguments it is a compile-time error.

For functions with variable number of parameters, the arity-specifying suffix can be omitted.

marekjm commented 8 years ago

Assembler detects functions whose names end in /N where N is a non-negative integer, and checks if the number of parameters in calls to them conforms to their declared arity. The check if performed only if number of parameters can be detected at compile-time.

Functions without /N suffix in their names are not checked.