Re:My favorite Erlang program (2013)
by coldtea on Thursday September 07, 2023 @06:20AM
(#37416890)
And /0 is the local vm?
[ Parent
| on HN ]
Re:My favorite Erlang program (2013)
by chrisoverzero on Thursday September 07, 2023 @06:34AM
(#37417007)
`/0` refers to the arity of the function.
Re:My favorite Erlang program (2013)
by codemonkey-zeta on Thursday September 07, 2023 @07:23AM
(#37417370)
It's the arity of the function. In Erlang there are no variadic functions, but functions with different arities can have the same name, so universal_server/0 takes no arguments, fib/1 takes 1 argument, fib/2 takes 2 arguments, the second arg may be the accumulator for a recursive Fibonacci, for example, and fib/1 may call fib/2 as an implementation detail.