Closed mohanson closed 5 years ago
according to wikipedia, the ultimate source of truth in the known universe:
In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands that the function takes. The arity of a relation is the dimension of the domain in the corresponding Cartesian product. The term springs from words like unary, binary, ternary, etc. Unary functions or predicates may be also called "monadic"; similarly, binary functions may be called "dyadic".
e.g.:
func f1(n int) { ... }
func f2(a, b int) { ... }
func f3(a, b, c int) { ... }
f1
has an arity of 1 (it takes 1 argument)f2
has an arity of 2 (it takes 2 arguments)f3
has an arity of 3
I guess one could extend this to the number of returned values too.
I try to understand your code, and when I was looking at the WebAssembly Core Specification, a problem plagued me for a long time:
Core Spec: 4.4.5.3. block [t?] instr∗ end Says:
Let n be the arity ∣t∣ of the result type t
What's the mean of arity?